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.
GUID in PostgreSQL...
If you need unique identifier of each record, use the following syntax:
For more information about oids please see PostgreSQL Server documentation.
Code: Select all
CREATE TABLE tablename
(
...
)
WITH OIDS;
-
- Posts: 6
- Joined: Sun 09 Sep 2007 10:26
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.
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.
Isn't it possible to create a new type for PostgreSQL and use it with CoreLab Data Provider?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.