dbTalk Databases Forums  

[BUGS] BUG #2749: Function's final statement must be a SELECT

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2749: Function's final statement must be a SELECT in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Hagen
 
Posts: n/a

Default [BUGS] BUG #2749: Function's final statement must be a SELECT - 11-10-2006 , 12:18 AM







The following bug has been logged online:

Bug reference: 2749
Logged by: Hagen
Email address: sixtus (AT) gmail (DOT) com
PostgreSQL version: 8.2beta2
Operating system: OSX
Description: Function's final statement must be a SELECT
Details:

create function test(text) returns table as $sql$
insert into table(value) values($1) returning *;
$sql$ language sql;


really should work now, instead I get:
PGError: ERROR: return type mismatch in function declared to return table
DETAIL: Function's final statement must be a SELECT.

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #2749: Function's final statement must be a SELECT - 11-10-2006 , 01:05 AM






"Hagen" <sixtus (AT) gmail (DOT) com> writes:
Quote:
create function test(text) returns table as $sql$
insert into table(value) values($1) returning *;
$sql$ language sql;

really should work now,
No doubt, but it's not happening for 8.2. See thread here:
http://archives.postgresql.org/pgsql...0/msg00665.php
There's a lot more to it than meets the eye :-(

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.