Re: [SQL] Problems with temp table and PL

2007-02-21 Thread A. Kretschmer
am Wed, dem 21.02.2007, um 18:17:50 -0300 mailte Martin Marques folgendes: > I create a temp table inside a plpgsql function, which is drop just before > ending (the function). > > My problem is that if I execute the same function again (in the same > session) I get an error when trying to inse

Re: [SQL] Problems with temp table and PL

2007-02-21 Thread Andrew Sullivan
On Wed, Feb 21, 2007 at 06:17:50PM -0300, Martin Marques wrote: > My problem is that if I execute the same function again (in the same > session) I get an error when trying to insert data into it (looks like the > session has an old reference of the table): You have to use EXECUTE for this. See

[SQL] Problems with temp table and PL

2007-02-21 Thread Martin Marques
I create a temp table inside a plpgsql function, which is drop just before ending (the function). My problem is that if I execute the same function again (in the same session) I get an error when trying to insert data into it (looks like the session has an old reference of the table): => SEL

[SQL] how to generate a list of distinct scalar values from a column which type is array

2007-02-21 Thread Sergio Andreozzi
Dear all, given a column which type is for instance varchar(20)[], is there any SQL command that let me generate the list of distinct scalar values? e.g.: col1 row 1: (aaa, bb, c) row 2: (, ) row 3: (aaa, ) the query should return: aaa bb c if not, I guess t

Re: [SQL] Problem with Temp Table and Result Set from PL Function...

2007-02-21 Thread devil live
I solved the problem as select * from MYFUNC(); instead of select MYFUNC(); From: "devil live" <[EMAIL PROTECTED]> To: pgsql-sql@postgresql.org Subject: [SQL] Problem with Temp Table and Result Set from PL Function... Date: Wed, 21 Feb 2007 11:31:02 + When I run following Function wit

[SQL] Problem with Temp Table and Result Set from PL Function...

2007-02-21 Thread devil live
When I run following Function with the following SETOF table... it says: NOTICE: table "temp_production_product_operations" does not exist, skipping CONTEXT: SQL statement "drop table if exists temp_production_product_operations " PL/pgSQL function "pb_report_temp_gerceklesme12" line 11 at