Re: Basic Trigger

Поиск
Список
Период
Сортировка
От Einar Karttunen
Тема Re: Basic Trigger
Дата
Msg-id 20021118113015.GA19319@melkinpaasi.cs.Helsinki.FI
обсуждение исходный текст
Ответ на Basic Trigger  ("Roberto de Amorim" <roberto@smartbit.inf.br>)
Список pgsql-general
On 18.11 09:13, Roberto de Amorim wrote:
> I did some Trigger to set default values for each row interted.
> so, I'm using NEW.ID = NEXTVAL(''products_id_seq'');
> but the column do not assum this value...
> must I execute any other command before to set a value for NEW?

Why not use serial datatype in this case?
http://www.postgresql.org/idocs/index.php?datatype.html#DATATYPE-SERIAL

If you want to have a trigger inserting a default a value, why
not just add a DEFAULT clause to the table definition / use
alter table?

If you want to create the trigger by yourself, first read:
http://www.postgresql.org/idocs/index.php?triggers.html

- Einar Karttunen

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

Предыдущее
От: "Roberto de Amorim"
Дата:
Сообщение: Basic Trigger
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Basic Trigger