Re: getting back autonumber just inserted
От | Michael Fuhr |
---|---|
Тема | Re: getting back autonumber just inserted |
Дата | |
Msg-id | 20050708032839.GA53708@winnie.fuhr.org обсуждение исходный текст |
Ответ на | Re: getting back autonumber just inserted (PFC <lists@boutiquenumerique.com>) |
Список | pgsql-sql |
On Fri, Jul 08, 2005 at 05:03:37AM +0200, PFC wrote: > >On Fri, Jul 08, 2005 at 01:56:26AM +0200, PFC wrote: > >>Hm, interesting, you mean the return value of lastval() also depends > >>if you set your constraints to deferred or immediate ? > > > >My mind's ablank trying to contrive a situation where that would > >matter. Can you provide an example? > > It's rather perverse and farfetched, but what would stop one from > putting some insert statements in a function that happens to be called > somewhere inside of a check constraint... although one could agree that > it's a bit shooting oneself in the foot... PostgreSQL doesn't support deferral of check constraints, only foreign key constraints. But yeah, if you could do that then presumably lastval() might return a different sequence's value depending on whether the constraints were deferred or immediate. -- Michael Fuhr http://www.fuhr.org/~mfuhr/
В списке pgsql-sql по дате отправления: