X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A684FD6E1A for ; Tue, 6 Sep 2005 06:00:20 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 84255-08 for ; Tue, 6 Sep 2005 09:00:15 +0000 (GMT) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by svr1.postgresql.org (Postfix) with ESMTP id B53F0D6D8A for ; Tue, 6 Sep 2005 06:00:15 -0300 (ADT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1ECZHy-0002I2-4x for pgsql-sql@postgresql.org; Tue, 06 Sep 2005 10:58:46 +0200 Received: from srv.protecting.net ([212.126.218.242]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Sep 2005 10:58:46 +0200 Received: from hf0614x by srv.protecting.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Sep 2005 10:58:46 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: Harald Fuchs Subject: Re: ERROR: syntax error at or near "select" at character 9 Date: 06 Sep 2005 10:57:58 +0200 Organization: Linux Private Site Lines: 28 Message-ID: <871x427euh.fsf@srv.protecting.net> References: <4317FE8C.7020803@axis.hu> <20050905213103.F5782@megazone.bigpanda.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: srv.protecting.net User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.082 required=5 tests=[AWL=0.082] X-Spam-Level: X-Archive-Number: 200509/58 X-Sequence-Number: 22605 In article <20050905213103.F5782@megazone.bigpanda.com>, Stephan Szabo writes: > On Fri, 2 Sep 2005, [ISO-8859-2] Graf L=E1szl=F3 wrote: >> >> CREATE FUNCTION test_verif() RETURNS trigger AS $test_verif$ >> BEGIN >> NEW.id :=3D 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 :=3D 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=E1szl=F3 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) );