Globally Unique IDs?

Started by Rose, Keithabout 25 years ago6 messagesgeneral
Jump to latest
#1Rose, Keith
keithr@aiinet.com

I am new to the mailing list, but not new to postgres. I did search through
the mail-list archives, and didn't find an answer to this question. Oracle
has a concept of a "globally unique ID" which can be gotten from their
function call SYS_GUID(). Is there any plan to implement this (or something
analogous) in a future version of Postgres?

--
Keith Rose (ext. 2144)

#2Mitch Vincent
mitch@venux.net
In reply to: Rose, Keith (#1)
Re: Globally Unique IDs?

You can get the same result I suppose if you just use the same sequence
across all your tables.. Is Oracle doing anything more than that? You could
even make a quick function to get the next value from a sequence and call it
SYS_GUID() -- just an idea :-)

Good luck!

-Mitch
Software development :
You can have it cheap, fast or working. Choose two.

----- Original Message -----
From: "Rose, Keith" <keithr@aiinet.com>
To: "'PostgreSQL General'" <pgsql-general@postgresql.org>
Sent: Friday, March 30, 2001 1:42 PM
Subject: Globally Unique IDs?

I am new to the mailing list, but not new to postgres. I did search

through

the mail-list archives, and didn't find an answer to this question.

Oracle

has a concept of a "globally unique ID" which can be gotten from their
function call SYS_GUID(). Is there any plan to implement this (or

something

Show quoted text

analogous) in a future version of Postgres?

--
Keith Rose (ext. 2144)

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

#3Soma Interesting
dfunct@telus.net
In reply to: Rose, Keith (#1)
Re: Globally Unique IDs?

At 01:42 PM 3/30/2001 -0500, you wrote:

I am new to the mailing list, but not new to postgres. I did search through
the mail-list archives, and didn't find an answer to this question. Oracle
has a concept of a "globally unique ID" which can be gotten from their
function call SYS_GUID(). Is there any plan to implement this (or something
analogous) in a future version of Postgres?

I'm far from an expert with Postgresql, but I was just thinking the other
day that you could probably use a single "sequence" in postgres for a
number of tables to make sure id's are unique across multiple tables.

If your not familiar with sequences, see here:
http://www.postgresql.org/devel-corner/docs/user/datatype.html#DATATYPE-SERIAL

#4Rose, Keith
keithr@aiinet.com
In reply to: Soma Interesting (#3)
RE: Globally Unique IDs?

Well, that is what we are doing. I really haven't looked into Oracle's
implementation. I actually _just_ got Oracle installed (along-side our
postgres installation) to start playing with it.

-----Original Message-----
From: Mitch Vincent [mailto:mitch@venux.net]
Sent: Friday, March 30, 2001 1:47 PM
To: Rose, Keith; 'PostgreSQL General'
Subject: Re: Globally Unique IDs?

You can get the same result I suppose if you just use the same sequence
across all your tables.. Is Oracle doing anything more than that? You could
even make a quick function to get the next value from a sequence and call it
SYS_GUID() -- just an idea :-)

Good luck!

-Mitch
Software development :
You can have it cheap, fast or working. Choose two.

----- Original Message -----
From: "Rose, Keith" <keithr@aiinet.com>
To: "'PostgreSQL General'" <pgsql-general@postgresql.org>
Sent: Friday, March 30, 2001 1:42 PM
Subject: Globally Unique IDs?

I am new to the mailing list, but not new to postgres. I did search

through

the mail-list archives, and didn't find an answer to this question.

Oracle

has a concept of a "globally unique ID" which can be gotten from their
function call SYS_GUID(). Is there any plan to implement this (or

something

Show quoted text

analogous) in a future version of Postgres?

--
Keith Rose (ext. 2144)

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

#5Mike Mascari
mascarm@mascari.com
In reply to: Rose, Keith (#4)
RE: Globally Unique IDs?

I believe Oracle's SYS_GUID will return an ID unique *throughout the world*
on *all hosts*. Other software uses GUID's for thinks like COM identifiers.
Typical output looks like:

351e1cc0-2540-11d5-a5cd-00036d15ee51

and is generated through some heuristics involving the current date, time,
MAC address, etc. I don't know the specifics -- except that the ID
generated will not be generated by anyone else anywhere. This would be a
useful addition, IMHO.

Mike Mascari
mascarm@mascari.com

-----Original Message-----
From: Soma Interesting [SMTP:dfunct@telus.net]
Sent: Friday, March 30, 2001 2:06 PM
To: Rose, Keith; pgsql-general@postgresql.org
Subject: Re: [GENERAL] Globally Unique IDs?

At 01:42 PM 3/30/2001 -0500, you wrote:

I am new to the mailing list, but not new to postgres. I did search

through

the mail-list archives, and didn't find an answer to this question.

Oracle

has a concept of a "globally unique ID" which can be gotten from their
function call SYS_GUID(). Is there any plan to implement this (or

something

analogous) in a future version of Postgres?

I'm far from an expert with Postgresql, but I was just thinking the other
day that you could probably use a single "sequence" in postgres for a
number of tables to make sure id's are unique across multiple tables.

If your not familiar with sequences, see here:
http://www.postgresql.org/devel-corner/docs/user/datatype.html#DATATYPE-
SERIAL

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

#6Doug McNaught
doug@wireboard.com
In reply to: Mike Mascari (#5)
Re: Globally Unique IDs?

Mike Mascari <mascarm@mascari.com> writes:

I believe Oracle's SYS_GUID will return an ID unique *throughout the world*
on *all hosts*. Other software uses GUID's for thinks like COM identifiers.
Typical output looks like:

351e1cc0-2540-11d5-a5cd-00036d15ee51

and is generated through some heuristics involving the current date, time,
MAC address, etc. I don't know the specifics -- except that the ID
generated will not be generated by anyone else anywhere. This would be a
useful addition, IMHO.

I can see this being useful but I'm not sure it should go into the
core system--it could be an external function in the contrib/
section. We've gotten along without it so far...

Oracle is a great system but it suffers from extreme bloat.

Just MHO of course...

-Doug