From: silly sad <sad@bankir.ru>
Cc: pgsql-sql@postgresql.org
Subject: Re: very frustrating feature-bug
Date: Wed, 17 Feb 2010 14:34:25 +0300
Message-ID: <4B7BD441.1080201@bankir.ru> (raw)
In-Reply-To: <hlghmo$3g2$2@reversiblemaps.ath.cx>
References: <4B7B98AF.9050202@bankir.ru>
<hlghmo$3g2$2@reversiblemaps.ath.cx>
On 02/17/10 13:51, Jasen Betts wrote:
> On 2010-02-17, silly sad<sad@bankir.ru> wrote:
>>
>> acc=>
>>
>> CREATE OR REPLACE FUNCTION add_user (TEXT, TEXT, TEXT, TEXT)
>> RETURNS usr AS $$
>> INSERT INTO usr (login,pass,name,email) VALUES ($1,$2,$3,$4)
>> RETURNING usr.*;
>> $$ LANGUAGE sql SECURITY DEFINER;
>>
>> acc=>
>>
>> ERROR: return type mismatch in function declared to return usr
>> DETAIL: Function's final statement must be a SELECT.
>> CONTEXT: SQL function "add_user"
>>
>> SURPRISE :-) SURPRISE :-)
>
> SQL functions are inlined when invoked, and so must be valid subselects.
>
> rewrite it in plpgsql.
thanx for advice.
may i ask? when this feature will be fixed?
(now i am using 8.3.9)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: sad@bankir.ru
Subject: Re: very frustrating feature-bug
In-Reply-To: <4B7BD441.1080201@bankir.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox