Re: Create function statement with insert statement

From: Joe Conway <mail(at)joeconway(dot)com>
To: Susan Hoddinott <susan(at)hexworx(dot)com>
Cc: a(dot)schmitz(at)cityweb(dot)de, pgsql-sql(at)postgresql(dot)org
Subject: Re: Create function statement with insert statement
Date: 2003-03-14 19:37:53
Message-ID: 3E722F91.6070506@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message David Delorme 2003-03-14 20:06:41 MapInfo and PostgreSQL how-to
Previous Message Susan Hoddinott 2003-03-14 18:58:22 Re: Create function statement with insert statement