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
Thanks,
I'll try to implement it.
Marcel
---(end of broadcast)---
TIP 4: Have you searched our list archives?
http://archives.postgresql.org/
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
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
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,
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