Re: Trigger

From: Pavel Rabel <pavel(at)sajt(dot)cz>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Trigger
Date: 2005-02-16 20:53:07
Message-ID: 4213B2B3.7070502@sajt.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

  • Trigger at 2005-02-16 13:44:30 from Eugen Gass

Browse pgsql-sql by date

  From Date Subject
Next Message PFC 2005-02-16 21:22:57 Re: UPDATE TRIGGER on view WAS: Re: Relation in tables
Previous Message Geoffrey 2005-02-16 20:51:00 Re: Order of columns in a table important in a stored procedure?