Re: ERROR: syntax error at or near "select" at character 9 - Mailing list pgsql-sql

From Harald Fuchs
Subject Re: ERROR: syntax error at or near "select" at character 9
Date
Msg-id 871x427euh.fsf@srv.protecting.net
Whole thread Raw
In response to ERROR: syntax error at or near "select" at character 9  (Graf László <graf.laszlo@axis.hu>)
Responses Re: ERROR: syntax error at or near "select" at character 9
List pgsql-sql
In article <20050905213103.F5782@megazone.bigpanda.com>,
Stephan Szabo <sszabo@megazone.bigpanda.com> writes:

> On Fri, 2 Sep 2005, [ISO-8859-2] Graf László wrote:

>>
>> CREATE FUNCTION test_verif() RETURNS trigger AS $test_verif$
>> BEGIN
>> NEW.id := select nextval('test_azon_seq');

> I think you want to remove select here, you're already effectively doing a
> select of the right hand side in the assignment.

>> NEW.nev := nev;
> I think you want to remove this line entirely.  What nev were you
> expecting on the right hand side?  If it's the new one, well, NEW.new is
> already that.

László could also remove the entire trigger and use something like


CREATE TABLE test ( id SERIAL NOT NULL, nev VARCHAR(25), datum TIMESTAMP NOT NULL DEFAULT current_timestamp, PRIMARY
KEY(id) 
);



pgsql-sql by date:

Previous
From: "Thomas F. O'Connell"
Date:
Subject: Re: Searching for results with an unknown amount of data
Next
From: Stephan Szabo
Date:
Subject: Re: ERROR: syntax error at or near "select" at character 9