Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 917CB9FBA8D for ; Wed, 21 Feb 2007 17:17:57 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 88750-02 for ; Wed, 21 Feb 2007 17:17:55 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from bugs.unl.edu.ar (bugs.unl.edu.ar [168.96.132.208]) by postgresql.org (Postfix) with ESMTP id 6269A9FBA0C for ; Wed, 21 Feb 2007 17:17:54 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by bugs.unl.edu.ar (Postfix) with ESMTP id D5B536F91B for ; Wed, 21 Feb 2007 18:17:51 -0300 (ART) Received: from bugs.unl.edu.ar ([127.0.0.1]) by localhost (bugs.unl.edu.ar [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wq2fHMlxRCi8 for ; Wed, 21 Feb 2007 18:17:51 -0300 (ART) Received: by bugs.unl.edu.ar (Postfix, from userid 1000) id B1E4E6F908; Wed, 21 Feb 2007 18:17:50 -0300 (ART) Received: from localhost (localhost [127.0.0.1]) by bugs.unl.edu.ar (Postfix) with ESMTP id 916B3FF07 for ; Wed, 21 Feb 2007 18:17:50 -0300 (ART) Date: Wed, 21 Feb 2007 18:17:50 -0300 (ART) From: Martin Marques To: pgsql-sql@postgresql.org Subject: Problems with temp table and PL Message-ID: MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50 X-Spam-Level: Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Archive-Number: 200702/215 X-Sequence-Number: 27549 I create a temp table inside a plpgsql function, which is drop just before= =20 ending (the function). My problem is that if I execute the same function again (in the same=20 session) I get an error when trying to insert data into it (looks like the= =20 session has an old reference of the table): =3D> SELECT actualizacionAnualProximoHabil(2008); ERROR: relation with OID 9668312 does not exist CONTEXT: SQL statement "INSERT INTO dias_semana VALUES ( $1 )" PL/pgSQL function "actualizacionanualproximohabil" line 9 at SQL statement As I said, the first execution works OK, but from then on it gives this=20 error, until I close the session and open it again. Any ideas? -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 --------------------------------------------------------- Lic. Mart=EDn Marqu=E9s | SELECT 'mmarques' || Centro de Telem=E1tica | '@' || 'unl.edu.ar'; Universidad Nacional | DBA, Programador, del Litoral | Administrador ---------------------------------------------------------=