X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 93AEB475EE2 for ; Thu, 8 May 2003 15:22:19 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 1030C474E4F for ; Thu, 8 May 2003 15:22:16 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id C59EED605; Thu, 8 May 2003 12:22:16 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id BB4DA5C0B; Thu, 8 May 2003 12:22:16 -0700 (PDT) Date: Thu, 8 May 2003 12:22:16 -0700 (PDT) From: Stephan Szabo To: =?iso-8859-2?B?U1rbQ1MgR+Fib3I=?= Cc: Subject: Re: "too clever" when creating SQL functions In-Reply-To: <009101c31580$b042a260$0a03a8c0@fejleszt2> Message-ID: <20030508122129.F46321-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: QUOTED-PRINTABLE X-Spam-Status: No, hits=-16.1 required=5.0 tests=BAYES_00,EMAIL_ATTRIBUTION,IN_REP_TO autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/178 X-Sequence-Number: 13343 On Thu, 8 May 2003, [iso-8859-2] SZ=DBCS G=E1bor wrote: > didn't make it in data-only (-a) mode either. I forgot to mention that it probably requires that there be foreign keys. :) But, it basically does: -- Disable triggers UPDATE "pg_class" SET "reltriggers" =3D 0 WHERE "relname" =3D 'a'; COPY "a" FROM stdin; \. -- Enable triggers UPDATE pg_class SET reltriggers =3D (SELECT count(*) FROM pg_trigger where pg_class.oid =3D tgrelid) WHERE relname =3D 'a';