Greetings:

I have have a plpgsql function that creates a temporary table to facilitate 
some processing. Here is the code:
    CREATE TEMP TABLE tmp (code         VARCHAR,
                           booked       INTEGER,
                           avail        INTEGER,
                           covered      INTEGER,
                           profit       NUMERIC (10,2),
                           billed       NUMERIC (10,2))
            WITHOUT OIDS ON COMMIT DROP;

Note the "ON COMMIT DROP". I would expect this table to disapear after the 
function completes, but it does not. Also, if I execute the the function 
twice in a row from the psql interface, on the second try, I get the 
following error:
sev=# select * from custSprtRpt('04/01/06', current_date);
NOTICE:  custSprtRpt ()
ERROR:  relation with OID 123654 does not exist
CONTEXT:  PL/pgSQL function "custsprtrpt" line 39 at SQL statement

If have to reload the function with \i sqlfunc/custSprtRpt.plsql so that it 
will work again. Why is this?

Also, this function does not perform any updates to a permanent database 
table.

Anyone have any insight into this issue?

sev=# select version();
                                                   version
--------------------------------------------------------------------------------------------------------------
 PostgreSQL 7.4.6 on i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 3.2.3 
20030502 (Red Hat Linux 3.2.3-49)
(1 row)

Thanks...
-- 
Terry Tucker
Turbo's IT Manager
Turbo, division of Ozburn-Hessey Logistics
2251 Jesse Jewell Pkwy NE
Gainesville, GA 30501
Tel: (336) 372-6812  Fax: (336) 372-6812  Cell: (336) 363-4719
[EMAIL PROTECTED]
www.turbocorp.com

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to