Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group