码迷,mamicode.com
首页 > 其他好文 > 详细

HOW TO: How to import UUID function into Postgre 9.3

时间:2014-11-12 19:51:25      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:style   blog   io   color   os   sp   on   2014   log   

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 above 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() ;

 

 

HOW TO: How to import UUID function into Postgre 9.3

标签:style   blog   io   color   os   sp   on   2014   log   

原文地址:http://blog.csdn.net/yexianyi/article/details/41047323

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!