How to: How to import UUID function into Postgre 9.3, uuidpostgre

Source: Internet
Author: User

How to: How to import UUID function into Postgre 9.3, uuidpostgre

1. Open a command console and go to the directory where you installed Postgre server.

E.g. D: \ Program Files \ PostgreSQL \ 9.3 \ bin>

2. Drill down into BIN folder and issue following command.

psql -d <database name> -U <username>

3. Issue create extension command to import extension

CREATE EXTENSION "uuid-ossp" ;

NOTICE: There is a semicolon at the end of command.

4. After abve steps, you can check if the extension has been imported successfully by calling following command.

 select * from pg_extension;

5. If succeed, you should be able to see the list as below.

Extname | extowner | extnamespace | extrelocatable | extversion | extconfig | extcondition
----------- + ---------- + -------------- + ---------------- + ------------ + ----------- + --------------
Plpgsql | 10 | 11 | f | 1.0 |
Uuid-ossp | 89286 | 2200 | t | 1.0 |

6. Now, you may generate UUID by uuid_generate_v4 ()

select uuid_generate_v4() ;

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.