BUG #4710: Bug with sql functions, when using INSERT.. RETURNING .. statment - Mailing list pgsql-bugs

From Oleg
Subject BUG #4710: Bug with sql functions, when using INSERT.. RETURNING .. statment
Date
Msg-id 200903171254.n2HCs7tP062720@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #4710: Bug with sql functions, when using INSERT.. RETURNING .. statment  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      4710
Logged by:          Oleg
Email address:      serovOv@gmail.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 ?

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #4709: dump/restore introduces wrong CHECK constraint for inherited table
Next
From: "hanuman"
Date:
Subject: BUG #4711: no mirror found in country selection for download