Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id A00BEB5DBC7 for ; Mon, 10 Oct 2011 14:19:04 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 44690-08 for ; Mon, 10 Oct 2011 17:18:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail-qw0-f46.google.com (mail-qw0-f46.google.com [209.85.216.46]) by mail.postgresql.org (Postfix) with ESMTP id 8B731B5D80B for ; Mon, 10 Oct 2011 14:18:57 -0300 (ADT) Received: by qadb15 with SMTP id b15so4051838qad.19 for ; Mon, 10 Oct 2011 10:18:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=us5hVw51GbJVNHoeYfTQ5rnKmCBQLY57MThO2iWlPtQ=; b=eJwu3LXjahVLXxeqp72XvSoGGAreX+rXi/xzPWJnmnVc4FbEhXPzxRMMwhiSuXRQcR WbbygqMpITv8vi+vFckuluNBzb/o2Jw4ZxzWO7QdxkD90BXlstF95OwjopN4XkgFI6rR f+5EwPWUccaf4CVHG+9FbbCWEuFx47vSpxF34= MIME-Version: 1.0 Received: by 10.224.195.201 with SMTP id ed9mr11733752qab.41.1318267136978; Mon, 10 Oct 2011 10:18:56 -0700 (PDT) Received: by 10.229.159.14 with HTTP; Mon, 10 Oct 2011 10:18:56 -0700 (PDT) In-Reply-To: References: Date: Mon, 10 Oct 2011 13:18:56 -0400 Message-ID: Subject: Re: lo_manage trigger on updates From: Robert Haas To: Josh Kupershmidt Cc: pgsql-docs Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201110/15 X-Sequence-Number: 7015 On Thu, Aug 11, 2011 at 11:43 PM, Josh Kupershmidt wro= te: > I think the doc section about using lo_manage() as a trigger: > =A0 http://www.postgresql.org/docs/current/static/lo.html > > could have its example tweaked to use a column-level BEFORE UPDATE > trigger, so as to save unnecessary trigger firings. Something like the > attached, perhaps? Uh, wow. That syntax is horribly surprising, isn't it? My eyes want to parse it as: BEFORE (UPDATE OF raster) OR (DELETE ON image) ...which is totally wrong. I'm inclined to think that maybe we should leave that example as-is, and maybe add the variant you're proposing as a second example, showing how the basic version can be refined. > On a similar note, the warning on that page about truncates could be > softened if we extended the lo_manage() function to handle truncates, > and set it up as on ON TRUNCATE trigger as well. Patch? :-) --=20 Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company