X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 56B679DC848 for ; Sat, 18 Mar 2006 02:27:50 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 31684-01 for ; Sat, 18 Mar 2006 02:27:49 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 2C0069DC87B for ; Sat, 18 Mar 2006 02:27:48 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k2I6RkEX013575; Sat, 18 Mar 2006 01:27:46 -0500 (EST) To: Jeff Frost cc: pgsql-sql@postgresql.org Subject: Re: update before drop causes OID problems in transaction? In-reply-to: References: <10754.1142635969@sss.pgh.pa.us> Comments: In-reply-to Jeff Frost message dated "Fri, 17 Mar 2006 20:20:33 -0800" Date: Sat, 18 Mar 2006 01:27:46 -0500 Message-ID: <13574.1142663266@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.113 required=5 tests=[AWL=0.113] X-Spam-Score: 0.113 X-Spam-Level: X-Archive-Number: 200603/260 X-Sequence-Number: 24606 Jeff Frost writes: > I suspect I've answered my own question while preparing the test case. Is it > the use of pg_get_serial_sequence at the bottom of the transaction? If so, > why does it only have a problem when there is an update to credit_card_audit > in the transaction? No, I think it's that you've got a plpgsql trigger function that contains queries referring to credit_card_audit. Dropping and recreating that table invalidates plpgsql's cached plans for those queries. We do have in mind to fix this (Neil Conway was poking at it, last I heard) but it won't happen before 8.2 at the earliest. In the meantime I'm wondering why you are insistent on dropping and recreating credit_card_audit, as opposed to something less invasive like TRUNCATE. regards, tom lane