Re: [SQL] nextval - Mailing list pgsql-sql

From Patrice Hédé
Subject Re: [SQL] nextval
Date
Msg-id Pine.LNX.3.96.980527173525.28094A-100000@paris.ivo.fr
Whole thread Raw
In response to nextval  (Jerome ALET <alet@unice.fr>)
List 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/ ----------------------------------


pgsql-sql by date:

Previous
From: "Anton Stöckl"
Date:
Subject: Re: [SQL] nextval
Next
From: Mark Pulver
Date:
Subject: PDF of Programmer's Guide?