Re: [HACKERS] Enhancing PGSQL to be compatible with Informix SQL

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] Enhancing PGSQL to be compatible with Informix SQL
Дата
Msg-id 200001061611.LAA13385@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Enhancing PGSQL to be compatible with Informix SQL  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] Enhancing PGSQL to be compatible with Informix SQL  (Rod Chamberlin <rod@querix.com>)
Список pgsql-hackers
> However, if you need to know what value is being given to the
> inserted tuple, much the cleanest solution is to select nextval
> before inserting:
> 
>     SELECT nextval('sequenceobject');
>     INSERT INTO table VALUES(... , value-you-just-got, ...);
> 
> If you are always going to do that, then a trigger is a waste of cycles.

He can do:
    INSERT INTO table VALUES(... , nextval('sequenceobject'), ...);

and currval() will get him the previous nextval() value.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Oleg Broytmann
Дата:
Сообщение: Re: [HACKERS] New Search Engine ... UdmSearch
Следующее
От: The Hermit Hacker
Дата:
Сообщение: Re: [HACKERS] Enhancing PGSQL to be compatible with Informix SQL