Re: [HACKERS] SQL Triggers

From: jwieck(at)debis(dot)com (Jan Wieck)
To: darcy(at)druid(dot)net (D'Arcy J(dot)M(dot) Cain)
Cc: jwieck(at)debis(dot)com, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] SQL Triggers
Date: 1998-09-25 17:52:29
Message-ID: m0zMc2g-000EBPC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > The arguments aren't right and the return type too. Trigger
> > procedures take no arguments in their definition and return
> > OPAQUE type. They really return a tuple of the table they are
> > actually fired for.
>
> Not sure I follow. The argument is an int (or int4 as it defaults to)
> and I tried various combos of int and int4 in the procedure definition
>
> As for the opaque type return, I get an error message when I try to
> create an SQL function returning opaque. The "SELECT 1 AS ignore_this"
> is taken straight from the examples.

To clearify on that:

Trigger procedures cannot be created in the builtin SQL
language. The trigger manager calls trigger procedures
totally different from the process how SQL functions get
invoked. They must be written in C or one of the procedural
languages (PL/pgSQL or PL/Tcl).

>
> > Take a look at PL/pgSQL and it's docs which is already in the
> > CVS and will be shipped with 6.4.
>
> I have the current sources (I sup daily) but I couldn't find any examples
> of fcreate trigger.

There are over 800 lines of trigger and function code written
in PL/pgSQL. You'll find them in .../src/pl/plpgsql/test.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#======================================== jwieck(at)debis(dot)com (Jan Wieck) #

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jackson, DeJuan 1998-09-25 18:55:51 RE: [PHP3] [OFF-TOPIC] POSTGRES
Previous Message D'Arcy J.M. Cain 1998-09-25 17:07:59 Re: unfortunately...