Re: Automatically deleting dangling large object references.

From: "Robert B(dot) Easter" <reaster(at)comptechnews(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Automatically deleting dangling large object references.
Date: 2000-05-03 21:06:00
Message-ID: 00050317284209.00670@comptechnews
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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).

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Keith Grennan 2000-05-03 22:07:56 Newbie DB problem
Previous Message Terry Jarrard 2000-05-03 21:01:47 What do you think?