pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: Susan Hoddinott <susan@hexworx.com>
Cc: a.schmitz@cityweb.de
Cc: pgsql-sql@postgresql.org
Subject: Re: Create function statement with insert statement
Date: Fri, 14 Mar 2003 11:37:53 -0800
Message-ID: <3E722F91.6070506@joeconway.com> (raw)
In-Reply-To: <002a01c2ea5b$1c0e06c0$1f84fea9@oemcomputer>
References: <003201c2e876$3498a880$1f84fea9@oemcomputer>
	<200303141552.38325.a.schmitz@cityweb.de>
	<002a01c2ea5b$1c0e06c0$1f84fea9@oemcomputer>

Susan Hoddinott wrote:
> Hi Andrea,
> 
> That was my first attempt (i.e. using opaque) but unfortunately when I use
> "opaque" it tells me that SQL functions cannot return opaque.  The parse
> error is also occurring on the create function statement prior to any
> knowledge that the function is being used for a trigger.
> 

I haven't followed this thread too closely, but if you are trying to use 
a SQL function for a trigger, it won't work. From the docs:
(http://www.us.postgresql.org/users-lounge/docs/7.3/postgres/triggers.html)

   "Trigger functions can be written in C and most procedural languages,
    but not in SQL"

Try re-writing your function in PL/pgSQL. BTW, I think I saw from your 
other post that you don't have PL/pgSQL installed in the database you 
are using. See the createlang program or CREATE LANGUAGE statement:
http://www.us.postgresql.org/users-lounge/docs/7.3/postgres/app-createlang.html
http://www.us.postgresql.org/users-lounge/docs/7.3/postgres/sql-createlanguage.html

HTH,

Joe





view thread (14+ messages)  latest in thread

Message-ID: <3E722F91.6070506@joeconway.com>
Permalink:  ../3E722F91.6070506@joeconway.com/
Also on:    postgresql.org/message-id/3E722F91.6070506@joeconway.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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mail@joeconway.com, susan@hexworx.com, a.schmitz@cityweb.de
  Subject: Re: Create function statement with insert statement
  In-Reply-To: <3E722F91.6070506@joeconway.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