pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Werner Fraga <werner.fraga@computalog.com>
To: pgsql-sql@postgresql.org
Subject: problems creating functions and triggers
Date: Mon, 10 Jan 2000 15:32:19 -0700
Message-ID: <00011015363303.07948@shorty.edmonton.computalog.com> (raw)

I am having problems creating functions and triggers in Postgres 6.5.3
on Linux Mandrake 6.1.

1. I noticed that some examples show the LANGUAGE in the CREATE FUNCTION
command can be 'plpgsql'. However, if I try using this instead of 'sql', I get
ERROR: Unrecognized language specified in a CREATE FUNCTION ...
However, I read somewhere that triggers don't work with LANGUAGE 'sql'.

Am I missing some part of Postgres installation?

2. If I create a function successfully (with LANGUAGE 'sql', then try to
create a trigger using this function, I get

create function checkStationID (int4)
  returns int4 as
'select Station.StationID from Station where Station.StationID = $1;'
language 'SQL';
CREATE

create trigger ifStationExists
  BEFORE INSERT OR UPDATE ON Employee FOR EACH ROW
  EXECUTE PROCEDURE checkStationID (stationID);
ERROR:  CreateTrigger: function checkstationid() does not exist

Is this because LANGUAGE should be 'plpgsql'? The function does exist; I can
run it using 'Select checkStationID (5)'.

3. Is there anywhere I can find a list of the system tables? (that section in
Bruce's book is still empty...)



view thread (2+ messages)  latest in thread

Message-ID: <00011015363303.07948@shorty.edmonton.computalog.com>
Permalink:  ../00011015363303.07948@shorty.edmonton.computalog.com/
Also on:    postgresql.org/message-id/00011015363303.07948@shorty.edmonton.computalog.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: werner.fraga@computalog.com
  Subject: Re: problems creating functions and triggers
  In-Reply-To: <00011015363303.07948@shorty.edmonton.computalog.com>
  References: <00011015363303.07948@shorty.edmonton.computalog.com>

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

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