pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedUUID generation functions
10+ messages / 7 participants
[nested] [flat]
* UUID generation functions
@ 2008-06-02 18:52 Hyatt, Gordon <Gordon.Hyatt@joslin.harvard.edu>
0 siblings, 1 reply; 10+ messages in thread
From: Hyatt, Gordon @ 2008-06-02 18:52 UTC (permalink / raw)
To: pgsql-admin
Sorry for the OT post, but does anyone know if there are any internal
UUID generation functions in pg? I took a quick look at the 8.2 docs
and didn't find anything related.
I know I can spawn a call to the underlying system to get a UUID. The
problem is that calling out to the system for this tends to lock one
into a specific O/S. In the case of Linux, uuidgen is _usually_
available for this; on Windows, however, a custom app to call a specific
API would be necessary.
The idea I had was to call this internal UUID generation function in an
INSERT trigger to generate a unique, traceable that identifies a sample
as it traverses numerous information systems/databases.
Thanks in advance,
Gord Hyatt
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: UUID generation functions
@ 2008-06-02 19:19 Kevin Grittner <Kevin.Grittner@wicourts.gov>
parent: Hyatt, Gordon <Gordon.Hyatt@joslin.harvard.edu>
0 siblings, 2 replies; 10+ messages in thread
From: Kevin Grittner @ 2008-06-02 19:19 UTC (permalink / raw)
To: Gordon Hyatt <Gordon.Hyatt@joslin.harvard.edu>; pgsql-admin
>>> On Mon, Jun 2, 2008 at 1:52 PM, in message
<85AC2B55AEF4CC41A2145B60C7F88074026535@JDCMAIL4.joslin.harvard.edu>,
"Hyatt,
Gordon" <Gordon.Hyatt@joslin.harvard.edu> wrote:
> does anyone know if there are any internal
> UUID generation functions in pg? I took a quick look at the 8.2
docs
> and didn't find anything related.
Any chance of going to 8.3?
http://www.postgresql.org/docs/8.3/interactive/datatype-uuid.html
-Kevin
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: UUID generation functions
@ 2008-06-02 19:21 Hyatt, Gordon <Gordon.Hyatt@joslin.harvard.edu>
parent: Kevin Grittner <Kevin.Grittner@wicourts.gov>
1 sibling, 0 replies; 10+ messages in thread
From: Hyatt, Gordon @ 2008-06-02 19:21 UTC (permalink / raw)
To: pgsql-admin
Thanks Kevin,
Not yet - the plan is to migrate later this year or early next year.
There are a number of systems that will be upgraded at that time.
Gord
> -----Original Message-----
> From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]
> Sent: Monday, June 02, 2008 3:19 PM
> To: Hyatt, Gordon; pgsql-admin@postgresql.org
> Subject: Re: [ADMIN] UUID generation functions
>
> >>> On Mon, Jun 2, 2008 at 1:52 PM, in message
> <85AC2B55AEF4CC41A2145B60C7F88074026535@JDCMAIL4.joslin.harvard.edu>,
> "Hyatt,
> Gordon" <Gordon.Hyatt@joslin.harvard.edu> wrote:
> > does anyone know if there are any internal
> > UUID generation functions in pg? I took a quick look at the 8.2
> docs
> > and didn't find anything related.
>
> Any chance of going to 8.3?
>
> http://www.postgresql.org/docs/8.3/interactive/datatype-uuid.html
>
> -Kevin
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: UUID generation functions
@ 2008-06-02 22:11 John DeSoi <desoi@pgedit.com>
parent: Kevin Grittner <Kevin.Grittner@wicourts.gov>
1 sibling, 2 replies; 10+ messages in thread
From: John DeSoi @ 2008-06-02 22:11 UTC (permalink / raw)
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: Gordon Hyatt <Gordon.Hyatt@joslin.harvard.edu>; pgsql-admin
On Jun 2, 2008, at 3:19 PM, Kevin Grittner wrote:
> Any chance of going to 8.3?
>
> http://www.postgresql.org/docs/8.3/interactive/datatype-uuid.html
But 8.3 still does not generate UUIDs, only stores/compares them. From
the link above:
> PostgreSQL provides storage and comparison functions for UUIDs, but
> the core database does not include any function for generating
> UUIDs, because no single algorithm is well suited for every
> application.
For reasons mentioned by the other poster, it would be helpful if
PostgreSQL could generate them. Is there really more than 2 or 3
needed options where it would be huge code bloat to include sufficient
alternatives?
John DeSoi, Ph.D.
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: UUID generation functions
@ 2008-06-02 22:15 Milen A. Radev <milen@radev.net>
parent: John DeSoi <desoi@pgedit.com>
1 sibling, 1 reply; 10+ messages in thread
From: Milen A. Radev @ 2008-06-02 22:15 UTC (permalink / raw)
To: pgsql-admin
John DeSoi написа:
>
> On Jun 2, 2008, at 3:19 PM, Kevin Grittner wrote:
>
>> Any chance of going to 8.3?
>>
>> http://www.postgresql.org/docs/8.3/interactive/datatype-uuid.html
>
> But 8.3 still does not generate UUIDs, only stores/compares them. From
> the link above:
>
>> PostgreSQL provides storage and comparison functions for UUIDs, but
>> the core database does not include any function for generating UUIDs,
>> because no single algorithm is well suited for every application.
>
> For reasons mentioned by the other poster, it would be helpful if
> PostgreSQL could generate them. Is there really more than 2 or 3 needed
> options where it would be huge code bloat to include sufficient
> alternatives?
http://www.postgresql.org/docs/8.3/static/uuid-ossp.html
--
Milen A. Radev
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: UUID generation functions
@ 2008-06-02 22:18 Joshua D. Drake <jd@commandprompt.com>
parent: John DeSoi <desoi@pgedit.com>
1 sibling, 0 replies; 10+ messages in thread
From: Joshua D. Drake @ 2008-06-02 22:18 UTC (permalink / raw)
To: John DeSoi <desoi@pgedit.com>; +Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>; Gordon Hyatt <Gordon.Hyatt@joslin.harvard.edu>; pgsql-admin
On Mon, 2008-06-02 at 18:11 -0400, John DeSoi wrote:
> On Jun 2, 2008, at 3:19 PM, Kevin Grittner wrote:
>
> > Any chance of going to 8.3?
> >
> > http://www.postgresql.org/docs/8.3/interactive/datatype-uuid.html
> For reasons mentioned by the other poster, it would be helpful if
> PostgreSQL could generate them. Is there really more than 2 or 3
> needed options where it would be huge code bloat to include sufficient
> alternatives?
There has been excessive discussion on UUID generation. I would check
the archives. I know that one argument that I made is that pretty much
every language has some sort of UUID generation already, including those
we use for PL languages (excluding plpgsql).
Sincerely,
Joshua D. Drake
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: UUID generation functions
@ 2008-06-02 22:24 Milen A. Radev <milen@radev.net>
parent: Milen A. Radev <milen@radev.net>
0 siblings, 2 replies; 10+ messages in thread
From: Milen A. Radev @ 2008-06-02 22:24 UTC (permalink / raw)
To: pgsql-admin
Milen A. Radev написа:
> John DeSoi написа:
>>
>> On Jun 2, 2008, at 3:19 PM, Kevin Grittner wrote:
>>
>>> Any chance of going to 8.3?
>>>
>>> http://www.postgresql.org/docs/8.3/interactive/datatype-uuid.html
>>
>> But 8.3 still does not generate UUIDs, only stores/compares them. From
>> the link above:
>>
>>> PostgreSQL provides storage and comparison functions for UUIDs, but
>>> the core database does not include any function for generating UUIDs,
>>> because no single algorithm is well suited for every application.
>>
>> For reasons mentioned by the other poster, it would be helpful if
>> PostgreSQL could generate them. Is there really more than 2 or 3
>> needed options where it would be huge code bloat to include sufficient
>> alternatives?
>
> http://www.postgresql.org/docs/8.3/static/uuid-ossp.html
My bad - just realised the OP most probably needs a Windows-compatible
solution and uuid-ossp is not.
--
Milen A. Radev
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: UUID generation functions
@ 2008-06-03 13:43 Rommel the iCeMAn <icecrew@gmail.com>
parent: Milen A. Radev <milen@radev.net>
1 sibling, 0 replies; 10+ messages in thread
From: Rommel the iCeMAn @ 2008-06-03 13:43 UTC (permalink / raw)
To: pgsql-admin
>> But 8.3 still does not generate UUIDs, only stores/compares them
This is true, however, only last week I completed a successful pg 8.3
install and during the installation I was able to include UUID
generation functions as an option. I now have 10 functions called
uuid_something. The ones I use most begin with "uuid_generate". I can
call these functions from within my own stored procs.
Rommel the iCeMAn
Barbados, Caribbean.
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: UUID generation functions
@ 2008-06-03 13:55 Hyatt, Gordon <Gordon.Hyatt@joslin.harvard.edu>
parent: Milen A. Radev <milen@radev.net>
1 sibling, 1 reply; 10+ messages in thread
From: Hyatt, Gordon @ 2008-06-03 13:55 UTC (permalink / raw)
To: pgsql-admin
Please see my comments in line.
> -----Original Message-----
> From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-
> owner@postgresql.org] On Behalf Of Milen A. Radev
> Sent: Monday, June 02, 2008 6:24 PM
> To: pgsql-admin@postgresql.org
> Subject: Re: [ADMIN] UUID generation functions
>
> Milen A. Radev написа:
> > John DeSoi написа:
> >>
> >> On Jun 2, 2008, at 3:19 PM, Kevin Grittner wrote:
> >>
> >>> Any chance of going to 8.3?
> >>>
> >>> http://www.postgresql.org/docs/8.3/interactive/datatype-uuid.html
> >>
> >> But 8.3 still does not generate UUIDs, only stores/compares them. From
> >> the link above:
> >>
> >>> PostgreSQL provides storage and comparison functions for UUIDs, but
> >>> the core database does not include any function for generating UUIDs,
> >>> because no single algorithm is well suited for every application.
As far as I can see, there are really only 2 types, either time-based or random. I guess a third "type" could be one where 2 long integers are used to "generate" the UUID.
Would this really add that much code? I haven't yet implemented such algorithms to know - I've simply used the underlying systems services when I needed UUIDs.
> >>
> >> For reasons mentioned by the other poster, it would be helpful if
> >> PostgreSQL could generate them. Is there really more than 2 or 3
> >> needed options where it would be huge code bloat to include sufficient
> >> alternatives?
> >
> > http://www.postgresql.org/docs/8.3/static/uuid-ossp.html
>
> My bad - just realised the OP most probably needs a Windows-compatible
> solution and uuid-ossp is not.
>
Actually, I'm developing on Windows, but deploying on Linux (both the web-server and the DB server), so a solution that is independent of platform is the most desirable. I was hoping that PG would have something to generate UUIDs internally.
If PG doesn't have the ability to generate UUIDs, I'll put the code in the web-server (tomcat) to do so. I was hoping to have this functionality as close as possible to the persistence of the data (where rules of uniqueness and integrity can be more easily enforced).
Gord
>
> --
> Milen A. Radev
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: UUID generation functions
@ 2008-06-06 13:04 Peter Eisentraut <peter_e@gmx.net>
parent: Hyatt, Gordon <Gordon.Hyatt@joslin.harvard.edu>
0 siblings, 0 replies; 10+ messages in thread
From: Peter Eisentraut @ 2008-06-06 13:04 UTC (permalink / raw)
To: pgsql-admin; +Cc: Hyatt, Gordon <Gordon.Hyatt@joslin.harvard.edu>
Am Dienstag, 3. Juni 2008 schrieb Hyatt, Gordon:
> > > http://www.postgresql.org/docs/8.3/static/uuid-ossp.html
> >
> > My bad - just realised the OP most probably needs a Windows-compatible
> > solution and uuid-ossp is not.
>
> Actually, I'm developing on Windows, but deploying on Linux (both the
> web-server and the DB server), so a solution that is independent of
> platform is the most desirable. I was hoping that PG would have something
> to generate UUIDs internally.
It does. Read the above link.
^ permalink raw reply [nested|flat] 10+ messages in thread
end of thread, other threads:[~2008-06-06 13:04 UTC | newest]
Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-06-02 18:52 UUID generation functions Hyatt, Gordon <Gordon.Hyatt@joslin.harvard.edu>
2008-06-02 19:19 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
2008-06-02 19:21 ` Hyatt, Gordon <Gordon.Hyatt@joslin.harvard.edu>
2008-06-02 22:11 ` John DeSoi <desoi@pgedit.com>
2008-06-02 22:15 ` Milen A. Radev <milen@radev.net>
2008-06-02 22:24 ` Milen A. Radev <milen@radev.net>
2008-06-03 13:43 ` Rommel the iCeMAn <icecrew@gmail.com>
2008-06-03 13:55 ` Hyatt, Gordon <Gordon.Hyatt@joslin.harvard.edu>
2008-06-06 13:04 ` Peter Eisentraut <peter_e@gmx.net>
2008-06-02 22:18 ` Joshua D. Drake <jd@commandprompt.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox