From: Emanuel <postgres.arg@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: BUG #6043: Compilation PLpgsql Succesful but execution bad
Date: Fri, 27 May 2011 14:05:29 GMT
Message-ID: <201105271405.p4RE5Tid050879@wwwmaster.postgresql.org> (raw)
The following bug has been logged online:
Bug reference: 6043
Logged by: Emanuel
Email address: postgres.arg@gmail.com
PostgreSQL version: 9.1 beta
Operating system: Ubuntu 10.04 2.6.31
Description: Compilation PLpgsql Succesful but execution bad
Details:
postgres=# CREATE OR REPLACE FUNCTION p_() RETURNS TABLE (i int) AS $$
DECLARE
BEGIN
SELECT * FROM p; --<<<-- here must ne RETURN QUERY ..
END;
$$ LANGUAGE plpgsql;
CREATE FUNCTION
postgres=# select p_();
ERROR: query has no destination for result data
HINT: If you want to discard the results of a SELECT, use PERFORM instead.
CONTEXT: PL/pgSQL function "p_" line 4 at SQL statement
I don't know if it's really a bug or a feature request. But seems that the
function compiles well without checking the existence of a RETURN QUERY. I
think the best in this cases is raise an error during compilation.
Thougths?
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: postgres.arg@gmail.com
Subject: Re: BUG #6043: Compilation PLpgsql Succesful but execution bad
In-Reply-To: <201105271405.p4RE5Tid050879@wwwmaster.postgresql.org>
References: <201105271405.p4RE5Tid050879@wwwmaster.postgresql.org>
* 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