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 A6949D787B for ; Fri, 2 Sep 2005 04:30:34 -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 22309-02 for ; Fri, 2 Sep 2005 07:30:30 +0000 (GMT) Received: from SRVEXCHANGE.axis.hu (gate.axis.hu [195.228.194.36]) by svr1.postgresql.org (Postfix) with ESMTP id DE84FD738B for ; Fri, 2 Sep 2005 04:30:21 -0300 (ADT) Received: from [192.168.1.90] ([192.168.1.90]) by SRVEXCHANGE.axis.hu with Microsoft SMTPSVC(6.0.3790.0); Fri, 2 Sep 2005 09:26:05 +0200 Message-ID: <4317FE8C.7020803@axis.hu> Date: Fri, 02 Sep 2005 09:26:04 +0200 From: =?ISO-8859-2?Q?Graf_L=E1szl=F3?= User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org, peter_e@gmx.net Subject: ERROR: syntax error at or near "select" at character 9 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 02 Sep 2005 07:26:05.0162 (UTC) FILETIME=[94351CA0:01C5AF8F] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.232 required=5 tests=[AWL=-0.025, FORGED_RCVD_HELO=0.05, UPPERCASE_25_50=0.207] X-Spam-Level: X-Archive-Number: 200509/47 X-Sequence-Number: 22594 Hi I am using PG 8.0 on Win32, learning SQL. I dod create a table with the following SQL: CREATE TABLE test ( id integer, nev varchar(25), datum timestamp ); A sequence with: CREATE SEQUENCE "public"."test_azon_seq" INCREMENT 1 MINVALUE 101 MAXVALUE 9223372036854775807 START 101 CACHE 1 ; A before insert trigger: CREATE FUNCTION test_verif() RETURNS trigger AS $test_verif$ BEGIN NEW.id := select nextval('test_azon_seq'); NEW.nev := nev; NEW.datum := current_timestamp; RETURN NEW; END; $test_verif$ LANGUAGE plpgsql ; CREATE TRIGGER test_verif BEFORE INSERT ON test FOR EACH ROW EXECUTE PROCEDURE test_verif() ; When I issue the insert into "public"."test" (nev) values ('Graf László'); insert statement, it returns "ERROR: syntax error at or near "select" at character 9". Why? What is wrong? -- László Graf