Re: [GENERAL] newid() in postgres

2007-04-11 Thread Chris Fischer
Here's a PL/pgsql implementation I wrote.I'm sure critics will be able to improve upon it: CREATE or REPLACE FUNCTION "common"."newid"() RETURNS "pg_catalog"."varchar" AS $BODY$ DECLARE v_seed_value varchar(32); BEGIN select md5( inet_client_addr()::varchar || timeofday() || inet_server_ad

Re: [GENERAL] newid() in postgres

2007-04-09 Thread marcel.beutner
Thanks, I'll try to implement it. Marcel ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL] newid() in postgres

2007-04-07 Thread Postgres User
You'll need to create a custom function in Postgres to support this, which is fairly easy. It's been done before- do a search on Google: http://www.hclausen.net/psql.php On 5 Apr 2007 01:27:15 -0700, marcel.beutner <[EMAIL PROTECTED]> wrote: Hello, Thanks a lot for your answers! But I don't n

Re: [GENERAL] newid() in postgres

2007-04-06 Thread marcel.beutner
Hello, Thanks a lot for your answers! But I don't need a sequence which only will be incremented. I need a _real_ GUID just as the newid() function. Is there no way to generate such a GUID? I need a real GUID because I use them further in my host app. And my host app relies on it. Thanks for yo

Re: [GENERAL] newid() in postgres

2007-04-04 Thread Postgres User
Marcel, A sequence represents a unique identifier. You can call the function 'nextval' to get the next unique value in the sequence. See related functions here: http://www.postgresql.org/docs/8.2/interactive/functions-sequence.html In this code, I get the next sequence, insert it into a table,

Re: [GENERAL] newid() in postgres

2007-04-04 Thread Peter Eisentraut
marcel.beutner wrote: > I've searched in the groups already, but couldn't find any helpful > information - only to use a sequence, which returns just a number and > not a unique identifier. Which properties do your unique identifiers posses that are not satisfied by a number returned by a sequenc