agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Pavel Rabel <pavel@sajt.cz>
To: pgsql-sql@postgresql.org
Subject: Re: Trigger
Date: Wed, 16 Feb 2005 20:53:07 +0000
Message-ID: <4213B2B3.7070502@sajt.cz> (raw)
In-Reply-To: <LKEAIFJAEICHBHJOIFOCIEBPCAAA.gass@intend.de>
References: <LKEAIFJAEICHBHJOIFOCIEBPCAAA.gass@intend.de>

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
>
>  
>




view thread (14+ messages)  latest in thread

Message-ID: <4213B2B3.7070502@sajt.cz>
Permalink:  ../4213B2B3.7070502@sajt.cz/
Also on:    postgresql.org/message-id/4213B2B3.7070502@sajt.cz

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: pavel@sajt.cz
  Subject: Re: Trigger
  In-Reply-To: <4213B2B3.7070502@sajt.cz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox