[BUGS] BUG #3851: suggestion - support for stored procedures

2008-01-05 Thread Lunter
The following bug has been logged online: Bug reference: 3851 Logged by: Lunter Email address: [EMAIL PROTECTED] PostgreSQL version: 9.0 ? Operating system: any Description:suggestion - support for stored procedures Details: Some database servers support stored proc

Re: [BUGS] BUG #3851: suggestion - support for stored procedures

2008-01-05 Thread Pavel Stehule
Hello use SETOF cursors. CREATE FUNCTION myfunc(refcursor, refcursor) RETURNS SETOF refcursor AS $$ BEGIN OPEN $1 FOR SELECT * FROM table_1; RETURN NEXT $1; OPEN $2 FOR SELECT * FROM table_2; RETURN NEXT $2; END; $$ LANGUAGE plpgsql; -- need to be in a transaction to use cursors.

[BUGS] pg_dump produces invalid SQL for "group by cast(null as numeric)"

2008-01-05 Thread Martin Pitt
Hi PostgreSQL developers, in [1], a user reported a failure of pg_dump: snip -- 1. Create an empty database. 2. Connect to the database and create these views: create view foo as select 3; create view bar as select count(*) from foo group by cast(null as numeric); 3. pg_dump t

Re: [BUGS] pg_dump produces invalid SQL for "group by cast(null as numeric)"

2008-01-05 Thread Tom Lane
Martin Pitt <[EMAIL PROTECTED]> writes: > create view bar as select count(*) from foo group by cast(null as numeric); > 3. pg_dump the database to a text file. The file contains >'CREATE VIEW bar AS >SELECT count(*) AS count FROM foo GROUP BY 2;' Actually, this seems to be provoking