Re: Create function statement with insert statement - Mailing list pgsql-sql

From Joe Conway
Subject Re: Create function statement with insert statement
Date
Msg-id 3E722F91.6070506@joeconway.com
Whole thread Raw
In response to Re: Create function statement with insert statement  ("Susan Hoddinott" <susan@hexworx.com>)
List pgsql-sql
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




pgsql-sql by date:

Previous
From: "Susan Hoddinott"
Date:
Subject: Re: Create function statement with insert statement
Next
From: "David Delorme"
Date:
Subject: MapInfo and PostgreSQL how-to