Re: [HACKERS] It is doing my head in

From: jwieck(at)debis(dot)com (Jan Wieck)
To: ajcblyth(at)glam(dot)ac(dot)uk (Blyth A J C)
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] It is doing my head in
Date: 1999-05-20 13:40:46
Message-ID: m10kT42-000EBeC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> So my question is - why does the create trigger function fail when the
> function does in
> fact exist ?

In fact - it does NOT exist!

First of all, the builtin 'sql' language cannot be used to
create triggers. This must be done in C or one of the
procedural languages PL/pgSQL and PL/Tcl.

The reason why the function doesn't exist is because a
trigger procedure is a function declared with no arguments
and a return type of OPAQUE. Except for the C language,
functions in PostgreSQL can be overloaded. Multiple different
functions can have the same name as long as their arguments
differ.

In reality trigger procedures take arguments. They are
defined at CREATE TRIGGER time. And they return one or no
database row of the table they are actually fired for.

The documentation how to create triggers is in chapters 11
and 13 of the PostgreSQL programmers manual.

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 Tom Lane 1999-05-20 13:57:49 Re: [HACKERS] It is doing my head in
Previous Message ZEUGSWETTER Andreas IZ5 1999-05-20 13:30:41 Re: [HACKERS] It is doing my head in