Re: FW: help with serial

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: FW: help with serial
Дата
Msg-id 42B69602.4050309@archonet.com
обсуждение исходный текст
Ответ на FW: help with serial  ("Luca Rasconi" <luca.rasconi@students.cefriel.it>)
Список pgsql-sql
Luca Rasconi wrote:
>  
> CREATE OR REPLACE RULE r1 AS
>     ON INSERT TO TABLE_A DO  INSERT INTO TABLE_B (uid) 
>   VALUES ((new.uid));

> how is it possible, why in a table 37 and in the other 37 + 1?

This is almost certainly the "nextval() evaluated twice" issue that 
catches everyone out from time to time. Check the mailing-list archives 
for discussion - it's because the rule acts as a macro, duplicating the 
expression.

--  Richard Huxton  Archonet Ltd


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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: info
Следующее
От: Din Adrian
Дата:
Сообщение: Re: UPDATEABLE VIEWS ... Examples?