X-Original-To: pgsql-sql@postgresql.org Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by postgresql.org (Postfix) with ESMTP id B646D47590C for ; Fri, 14 Mar 2003 14:40:17 -0500 (EST) Received: from [206.19.64.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.0.4) with ESMTP-TLS id 1664422; Fri, 14 Mar 2003 12:16:13 -0800 Message-ID: <3E722F91.6070506@joeconway.com> Date: Fri, 14 Mar 2003 11:37:53 -0800 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Susan Hoddinott Cc: a.schmitz@cityweb.de, pgsql-sql@postgresql.org Subject: Re: Create function statement with insert statement References: <003201c2e876$3498a880$1f84fea9@oemcomputer> <200303141552.38325.a.schmitz@cityweb.de> <002a01c2ea5b$1c0e06c0$1f84fea9@oemcomputer> In-Reply-To: <002a01c2ea5b$1c0e06c0$1f84fea9@oemcomputer> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200303/372 X-Sequence-Number: 12411 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