Re: [SQL] check constraint bug?

2011-05-08 Thread Lew
Scott Marlowe wrote: Tarlika Elisabeth Schmitz wrote: I specified: ALTER TABLE h ADD CONSTRAINT val_h_stats CHECK (NOT (sex = 'f') AND (stats IS NOT NULL)); which was translated to: ALTER TABLE h ADD CONSTRAINT val_h_stats CHECK (NOT sex = 'f'::bpchar AND stats IS NOT NULL); You need anoth

[SQL] FOR EACH STATEMENT trigger ?

2011-05-08 Thread Frédéric BROUARD
Hi there I am trying to get an example of SET BASED trigger logic with FOR EACH STATEMENT, but I cannot find any example involving the pseudo table NEW (or OLD) in the trigger function SQL statement. Let me give you a real life example. Suppose we have the above table : CREATE TABLE T_PRODU