From: | "Dann Corbit" <DCorbit(at)connx(dot)com> |
---|---|
To: | "Scott Marlowe" <smarlowe(at)g2switchworks(dot)com>, "John DeSoi" <desoi(at)pgedit(dot)com> |
Cc: | "Tino Wildenhain" <tino(at)wildenhain(dot)de>, "Riaan van der Westhuizen" <riaan(at)huizensoft(dot)co(dot)za>, "Postgresql-General" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: GUID for postgreSQL |
Date: | 2005-07-27 20:56:27 |
Message-ID: | D425483C2C5C9F49B5B7A41F8944154757CF68@postal.corporate.connx.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Windows uses the MAC address in GUID generation.
> -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-
> owner(at)postgresql(dot)org] On Behalf Of Scott Marlowe
> Sent: Wednesday, July 27, 2005 1:47 PM
> To: John DeSoi
> Cc: Tino Wildenhain; Riaan van der Westhuizen; Postgresql-General
> Subject: Re: [GENERAL] GUID for postgreSQL
>
> On Wed, 2005-07-27 at 15:32, John DeSoi wrote:
> > On Jul 27, 2005, at 4:49 AM, Tino Wildenhain wrote:
> >
> > > I'd create a sequence:
> > >
> > > CREATE SEQUENCE global_unique_id_seq;
> > >
> > > and a function:
> > >
> > > CREATE OR REPLACE FUNCTION newid()
> > > RETURNS text AS
> > > $BODY$ SELECT nextval('global_unique_id_seq')::text; $BODY$
> > > LANGUAGE 'sql' VOLATILE;
> > >
> > >
> > > now every call to newid() returns a garantied unique id for
> > > say the next 18446744073709551616 calls.
> > > Of course you can obfuscate the ID even more using
> > > md5, include servername and so on, but this will not improve
> > > security in any way (unless you mix data with 2nd database)
> >
> >
> > This is not really a viable replacement for a GUID == globally
unique
> > identifier. Here global means that if I use the application in
> > multiple databases, I'm guaranteed that no two identifiers will be
> > the same. Using a sequence will only support uniqueness for a single
> > database.
>
> So, how can two databases, not currently talking to one another,
> guarantee that their GUIDs don't collide? using a large randomly
> generated name space only reduces the chances of collision, it doesn't
> actually guarantee it.
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
From | Date | Subject | |
---|---|---|---|
Next Message | John DeSoi | 2005-07-27 20:57:21 | Re: GUID for postgreSQL |
Previous Message | Scott Marlowe | 2005-07-27 20:46:44 | Re: GUID for postgreSQL |