Re: [SQL] nextval

Patrice Hédé <patrice@idf.net>

From: Patrice Hédé <patrice@idf.net>
To: Jerome ALET <alet@unice.fr>
Cc: pgsql-sql@postgreSQL.org
Date: 1998-05-27T15:37:32Z
Lists: pgsql-sql
> CREATE SEQUENCE seq_slogans INCREMENT 1 MINVALUE 1 START 1;
> CREATE
> 
> CREATE RULE rule_i_slogans AS ON INSERT TO slogans DO UPDATE NEW SET
> numero_slogan = nextval(seq_slogans) , points_slogan = 10;
> ERROR:  attribute 'seq_slogans' not found
> 
> if I replace the "nextval(seq_slogans)" with a constant in the rule it
> works.

Maybe I've overlooked something, but you seem to have forgotten to put
quotes around the sequence name as :

   SELECT nextval('seq_slogans');

Hope this helps.

--
Patrice HÉDÉ --------------------------------- patrice@idf.net -----
                     ... Looking for a job in Iceland or in Norway !
Ingénieur informaticien   -   Computer engineer   -   Tölvufræðingur
----- http://www.idf.net/patrice/ ----------------------------------