Re: INSERT... RETURNING with a function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Iain Barnett <iainspeed(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: INSERT... RETURNING with a function
Date: 2009-09-26 18:57:34
Message-ID: 4080.1253991454@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Iain Barnett <iainspeed(at)gmail(dot)com> writes:
> I've written a straightforward insert function, but using the
> RETURNING keyword for the first time. If I try running the test case
> I get the error:

> ERROR: query has no destination for result data
> CONTEXT: PL/pgSQL function "nonauth_users_insert_new_udf" line 7 at
> SQL statement

I think you want INSERT ... RETURNING ... INTO some-plpgsql-variable;

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gerhard Wiesinger 2009-09-26 19:23:00 Re: pg_buffercache - A lot of "unnamed" relfilenodes?
Previous Message Adrian Klaver 2009-09-26 18:56:11 Re: INSERT... RETURNING with a function