Re: [BUGS] BUG #6043: Compilation PLpgsql Succesful but execution bad

2011-05-28 Thread Pavel Stehule
2011/5/28 Emanuel Calvo : >>> >>> Thanks Heikki for your fast response! ^^ >>> >>> The compiler would have to determine that the loop never ends, or it would complain that there's no RETURN at the end. Many compilers for other languages do that kind of analysis, but it usua

Re: [BUGS] BUG #6043: Compilation PLpgsql Succesful but execution bad

2011-05-28 Thread Emanuel Calvo
>> >> Thanks Heikki for your fast response! ^^ >> >> >>> The compiler would have to determine that the loop never ends, or it >>> would complain that there's no RETURN at the end. >>> >>> Many compilers for other languages do that kind of analysis, but it >>> usually only results in a warning, and

Re: [BUGS] BUG #6043: Compilation PLpgsql Succesful but execution bad

2011-05-28 Thread Pavel Stehule
2011/5/28 Emanuel Calvo : > El 27/05/2011 16:18, "Heikki Linnakangas" > escribió: >> On 27.05.2011 17:05, Emanuel wrote: >>> postgres=# CREATE OR REPLACE FUNCTION p_() RETURNS TABLE (i int) AS $$ >>> DECLARE >>> BEGIN >>> SELECT * FROM p; --<<<-- here must ne RETURN QUERY .. >>> END; >>> $$ LANGUA

Re: [BUGS] BUG #6043: Compilation PLpgsql Succesful but execution bad

2011-05-28 Thread Emanuel Calvo
El 27/05/2011 16:18, "Heikki Linnakangas" < heikki.linnakan...@enterprisedb.com> escribió: > On 27.05.2011 17:05, Emanuel wrote: >> postgres=# CREATE OR REPLACE FUNCTION p_() RETURNS TABLE (i int) AS $$ >> DECLARE >> BEGIN >> SELECT * FROM p; --<<<-- here must ne RETURN QUERY .. >> END; >> $$ LANGU

Re: [BUGS] BUG #6043: Compilation PLpgsql Succesful but execution bad

2011-05-27 Thread Heikki Linnakangas
On 27.05.2011 17:05, Emanuel wrote: 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 HIN

[BUGS] BUG #6043: Compilation PLpgsql Succesful but execution bad

2011-05-27 Thread Emanuel
The following bug has been logged online: Bug reference: 6043 Logged by: Emanuel Email address: postgres@gmail.com PostgreSQL version: 9.1 beta Operating system: Ubuntu 10.04 2.6.31 Description:Compilation PLpgsql Succesful but execution bad Details: postgres=#