Re: Triggers in Postgres - Mailing list pgsql-general

From Chris Mair
Subject Re: Triggers in Postgres
Date
Msg-id 1154424039.4837.3.camel@dell.home.lan
Whole thread Raw
In response to Re: Triggers in Postgres  ("Jasbinder Bali" <jsbali@gmail.com>)
Responses Re: Triggers in Postgres  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> http://www.postgresql.org/docs/8.1/interactive/triggers.html
>
> it says something like this:
>
> " It is not currently possible to write a trigger function in the
> plain SQL function language. "

The whole paragraph says.

"It is also possible to write a trigger function in C, although most
people find it easier to use one of the procedural languages. It is not
currently possible to write a trigger function in the plain SQL function
language."

That is: you can and you should write your trigger in a procedural
language. In particular - if you want to stay as closed as possible
to SQL you should use procedural SQL, which in PostgreSQL is called
PL/pgSQL:
http://www.postgresql.org/docs/8.1/interactive/plpgsql.html

Bye, Chris.



pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Error in PostgreSQL query with psycopg
Next
From: Tom Lane
Date:
Subject: Re: Triggers in Postgres