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 35C299DCDA8 for ; Sat, 18 Mar 2006 02:55:09 -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 33755-07 for ; Sat, 18 Mar 2006 02:55:09 -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 1409D9DCD94 for ; Sat, 18 Mar 2006 02:55:06 -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 k2I6t58V013833; Sat, 18 Mar 2006 01:55:05 -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> <13574.1142663266@sss.pgh.pa.us> Comments: In-reply-to Jeff Frost message dated "Fri, 17 Mar 2006 22:48:57 -0800" Date: Sat, 18 Mar 2006 01:55:05 -0500 Message-ID: <13832.1142664905@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/261 X-Sequence-Number: 24607 Jeff Frost writes: > On Sat, 18 Mar 2006, Tom Lane wrote: >> 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. > Is that the case whether the triggers are executed or not? If the trigger function hasn't ever been executed in the current session, it wouldn't have a cached plan ... but I suspect you meant "if it hasn't been executed in the current transaction", and that doesn't help. > However, we drop that trigger before > dropping credit_card_audit, so I'd think that would be ok. IIRC you'd have to drop the underlying plpgsql function, not only the trigger object that connects the function to a table. We cache stuff with respect to the function. regards, tom lane