X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4C0F68B9FEA for ; Wed, 16 Feb 2005 20:59:28 +0000 (GMT) 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 51194-03 for ; Wed, 16 Feb 2005 20:59:03 +0000 (GMT) Received: from n066.sc1.cp.net (fh1023.dia.cp.net [64.97.168.33]) by svr1.postgresql.org (Postfix) with ESMTP id 020428B9F44 for ; Wed, 16 Feb 2005 20:52:50 +0000 (GMT) Received: from [82.12.243.244] (82.12.243.244) by n066.sc1.cp.net (7.0.038) id 420C3F9F000A402C for pgsql-sql@postgresql.org; Wed, 16 Feb 2005 20:52:50 +0000 Message-ID: <4213B2B3.7070502@sajt.cz> Date: Wed, 16 Feb 2005 20:53:07 +0000 From: Pavel Rabel User-Agent: Debian Thunderbird 1.0 (X11/20050116) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: Trigger References: In-Reply-To: X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200502/265 X-Sequence-Number: 20375 It requires a bit more work in PostgreSQL to create a trigger. From the documentation: "It is not currently possible to write a SQL-language trigger function. Trigger functions can be written in C or in some of the available procedural languages." I guess you will prefer to write the trigger in PL/pgSQL, have a look at http://www.postgresql.org/docs/8.0/interactive/plpgsql-trigger.html Regards Pavel Eugen Gass wrote: >Hi, > >I'm trying to create a trigger on PostgreSQL > >it should be like an oracle(sql) sample code: > >create or replace trigger frei_polygon_sync >after INSERT on frei_polygon >Referencing NEW as newROW >for each row >Begin > :newRow.objektid := :newRow.gid; > : >end; > >Can sombody help me to do the same on Postrgres > >Thanks > >Best Regards > >EG > >---------------------------(end of broadcast)--------------------------- >TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq > > >