Large Object leakage - Mailing list pgsql-general

From Harald Fuchs
Subject Large Object leakage
Date
Msg-id pumxxnl942.fsf@srv.protecting.net
Whole thread Raw
List pgsql-general
I have a DB (mydb) where one table (mytbl) contains a large object
column.  The contents are managed by contrib/lo.  This breaks when I
want to copy the DB to another host where the schema is already
present with some old contents:  when I do

  pg_dump -c mydb | psql -q -h otherhost mydb -f -

pg_dump emits a "DROP TABLE mytbl" which leaves the old lo contents on
otherhost orphaned and, even worse, raises an exception if pg_dump
wants to create a large object with an id already present.  I thought
about a TRUNCATE TRIGGER which could make the appropriate lo_unlink
calls, but this trigger won't be called by DROP TABLE.

Any ideas?

pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: prevent connection using pgpass.conf
Next
From: Peter Geoghegan
Date:
Subject: Re: "1-Click" installer problems