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).