Re: [GENERAL] cursor question

2009-02-25 Thread Andreas Wenk
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pavel Stehule schrieb: > Hello > > when you would to change name of table - you have to use dynamic query > > 38.7.2.2. OPEN FOR EXECUTE > > OPEN unbound_cursor [ [ NO ] SCROLL ] FOR EXECUTE query_string; > > > http://www.postgresql.org/docs/8.3/i

Re: [GENERAL] cursor question

2009-02-25 Thread Pavel Stehule
Hello when you would to change name of table - you have to use dynamic query 38.7.2.2. OPEN FOR EXECUTE OPEN unbound_cursor [ [ NO ] SCROLL ] FOR EXECUTE query_string; http://www.postgresql.org/docs/8.3/interactive/plpgsql-cursors.html regards Pavel Stehule 2009/2/25 Andreas Wenk : > -BE

[GENERAL] cursor question

2009-02-25 Thread Andreas Wenk
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, short question. Why is this not possible: CREATE OR REPLACE FUNCTION user_cursor_open(text) RETURNS refcursor AS $$ DECLARE curs1 CURSOR FOR SELECT * FROM $1; BEGIN OPEN curs1; RETURN curs1; END; $$ LANGUAGE plpgsql; Or,