BUG #4710: Bug with sql functions, when using INSERT.. RETURNING .. statment

From: "Oleg" <serovOv(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4710: Bug with sql functions, when using INSERT.. RETURNING .. statment
Date: 2009-03-17 12:54:07
Message-ID: 200903171254.n2HCs7tP062720@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 4710
Logged by: Oleg
Email address: serovOv(at)gmail(dot)com
PostgreSQL version: last stable
Operating system: CentOS
Description: Bug with sql functions, when using INSERT.. RETURNING ..
statment
Details:

Example:

CREATE TABLE test (id BIGINT);
CREATE OR REPLACE FUNCTION test(in_row test) RETURNS bigint AS
$body$
INSERT INTO test (SELECT $1.*) RETURNING id;
$body$
LANGUAGE 'sql';

WILL THROW:

ERROR: return type mismatch in function declared to return bigint
DETAIL: Function's final statement must be a SELECT.
CONTEXT: SQL function "test"

It is okey ?

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message hanuman 2009-03-17 13:17:35 BUG #4711: no mirror found in country selection for download
Previous Message Tom Lane 2009-03-17 12:36:41 Re: BUG #4709: dump/restore introduces wrong CHECK constraint for inherited table