本文是小编为大家收集整理的关于在windows postgresql中生成uuid的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。
问题描述
我在Windows上安装了PostgreSQL 9,该安装没有在UUID发生器中内置.有OSSD软件包,可以将其作为UUID发电机的后Gostgresql,但仅用于 *NIX(我认为).
如何在Windows PostgreSQL中生成UUID?
推荐答案
来自EnterpriedeB的一单击安装程序确实具有它. dll称为" uuid-ossp.dll",驻留在"(Postgres的"安装目录")\ lib"中,安装sql脚本称为" uuid-ossp.sql",并驻留在"(Postgres's installation Directory)\ share)中. \ contry".您必须在选择的DB中执行最后一个.
其他推荐答案
uuid-ossp-module in贡献确实在Windows XP 32位上工作. 64位版本尚不可用,OSSP UUID库项目必须解决此问题.
其他推荐答案
在Windows上,我进行了以下操作以生成UUID:
使用此命令在命令提示符上登录到服务器:
psql -U postgres
这基本上是将postgresql作为root访问.
然后选择您希望此功能可用的数据库:
postgres=# \c <name of database>
然后执行以下执行:
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
然后通过立即执行:
测试SELECT uuid_generate_v4();
我建议您查看 uuid-ossp 可用的UUID功能.
问题描述
I have a postgresql 9 installation on windows, which doesn't have built in uuid generator. There is OSSD package, which can be bound to postgresql as uuid generator, but it's for *nix only (I think).
How can I generate uuid in windows postgresql?
推荐答案
The one-click installer from EnterpriseDB does have it. The DLL is called "uuid-ossp.dll" and resides in "(Postgres' installation directory)\lib" and the installation SQL script is called "uuid-ossp.sql" and resides in "(Postgres' installation directory)\share\contrib". You have to execute the last one in the DB of your choice.
其他推荐答案
The uuid-ossp-module in the contrib, does work on Windows XP 32 bits. The 64 bits version is not available yet, the OSSP UUID library project has to fix this problem.
其他推荐答案
On windows, I did the following to generate UUIDs:
Log into the server using this command on Command Prompt:
psql -U postgres
This is basically accessing PostgreSQL as root.
Then select the database you want this function to be available in:
postgres=# \c <name of database>
Then execute the following:
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
Then test by immediately executing:
SELECT uuid_generate_v4();
I recommend you review the uuid-ossp documentation on the available UUID functions.