Page 1 of 1
GUID in PostgreSQL...
Posted: Sun 09 Sep 2007 11:00
by burning snow
Hi folks,
Since I'm converting a project from MSSQL to PostgreSQL I don't know how to handle the GUID / uniqueidentifier Fields.
I know that PostgreSQL doesn't have this datatype but what is the best practice for this kind of problem?
Thank you very much in advance.
Posted: Mon 10 Sep 2007 08:22
by Alexey
If you need unique identifier of each record, use the following syntax:
Code: Select all
CREATE TABLE tablename
(
...
)
WITH OIDS;
For more information about oids please see PostgreSQL Server documentation.
Posted: Sun 30 Sep 2007 12:35
by burning snow
It is not possible to use OID for my problem.
Why?
In the PostgreSQL Documentation (
http://www.postgresql.org/docs/8.2/inte ... e-oid.html) it says that I can't use it like I use GUID on a MSSQL Database.
The oid type is currently implemented as an unsigned four-byte integer. Therefore, it is not large enough to provide database-wide uniqueness in large databases, or even in large individual tables. So, using a user-created table's OID column as a primary key is discouraged. OIDs are best used only for references to system tables.
Isn't it possible to create a new type for PostgreSQL and use it with CoreLab Data Provider?
Posted: Mon 01 Oct 2007 07:16
by Alexey
As far as we know, it is not possible to create new types in PostgreSQL Server.