Re: Example of RETURNING clause to get auto-generated keys

From: Ken Johanson <pg-user(at)kensystem(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Example of RETURNING clause to get auto-generated keys
Date: 2007-01-25 02:28:40
Message-ID: 45B815D8.9010702@kensystem.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> Now playing devil's advocate, can anyone see scenarios where this will
> not work as expected? Examples (descriptions not sql necessarily) of
> those would be helpful too...
>

Just to be sure, will the RETURNING clause work with custom sequences
(say, non numeric or increment by two) or other types of key
generators?... And how will triggers interfere with it (if at all)?

I honestly have limited experience with server generated keys that are
not numeric/serial (or uuids), or with cases where triggers,
constraints, etc might come into play (I'm used to using the DB mostly
as a storage device and using server-side logic..)

Ken

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2007-01-25 02:51:19 Re: Problem with replace
Previous Message Ken Johanson 2007-01-25 01:59:55 Re: Example of RETURNING clause to get auto-generated keys