Re: Automatically deleting dangling large object references. - Mailing list pgsql-general

From Robert B. Easter
Subject Re: Automatically deleting dangling large object references.
Date
Msg-id 00050317284209.00670@comptechnews
Whole thread Raw
In response to Automatically deleting dangling large object references.  ("Robert B. Easter" <reaster@comptechnews.com>)
Responses Newbie DB problem  (Keith Grennan <k.grennan@jach.hawaii.edu>)
List pgsql-general
On Tue, 02 May 2000, Robert B. Easter wrote:
> I was thinking of trying something like the following to automatically delete
> rows from tables that reference large objects when the large object is
> unlinked.  It would depend on pg_class having a PRIMARY key (on the hidden
> 'oid' column in this possible example):
[snip]

Nevermind, at least I can do the reverse - automatically unlink a large object
when the row that holds its oid is deleted:

CREATE RULE unlinkit AS
ON DELETE TO largeobjtable
DO SELECT lo_unlink(old.lgobjoid) FROM largeobjtable
WHERE largeobjtable.lgobjoid = old.lgobjoid;

This SELECT doesn't really do anything but call that lo_unlink function.
Kinda strange.  Can anyone see any problems with doing something like this in a
production database?  I'd like to know more about how people handle large
object consistency.

(newbie stuff, sorry).


pgsql-general by date:

Previous
From: Terry Jarrard
Date:
Subject: What do you think?
Next
From: Keith Grennan
Date:
Subject: Newbie DB problem