Re: Exclude pg_largeobject form pg_dump - Mailing list pgsql-general

From Andreas Joseph Krogh
Subject Re: Exclude pg_largeobject form pg_dump
Date
Msg-id VisenaEmail.55.46e0f617a1742ef3.15356e70f1f@tc7-visena
Whole thread Raw
In response to Re: Exclude pg_largeobject form pg_dump  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Exclude pg_largeobject form pg_dump
Re: Exclude pg_largeobject form pg_dump
List pgsql-general
På tirsdag 08. mars 2016 kl. 16:30:36, skrev Tom Lane <tgl@sss.pgh.pa.us>:
Andreas Joseph Krogh <andreas@visena.com> writes:
> P�� tirsdag 08. mars 2016 kl. 15:43:37, skrev Adrian Klaver <
> adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>>:
>  Do you care about not dumping the pg_largeobject table or not dumping
>  the data it contains?
>
> I have several tables with OID-columns and I'd like to dump my DB without any
> data in pg_largeobject (> 95% of the space is occupied by data in
> pg_largeobject).
> I've tried to exclude (using -T) the tables containing OID-columns but
> pg_largeobject is still dumped containing the data it seems.

A look at the pg_dump source code says that it skips blobs if any of
-s, -n, -t are used.  There's a -b switch to undo that and include
them anyway, but no "inverse -b" to skip them in an otherwise-complete
dump.

So you could do something along the lines of pg_dump -t '*' ...
although this will result in *all* non-schema-named objects being
excluded, I believe, which might be a problem.

regards, tom lane
 
Hm:
 
pg_dump -v -t '*' > andreak-noblob.dmp
pg_dump: reading extensions
pg_dump: identifying extension members
pg_dump: reading schemas
pg_dump: reading user-defined tables
pg_dump: [archiver (db)] query failed: ERROR:  permission denied for relation pg_authid
pg_dump: [archiver (db)] query was: LOCK TABLE pg_catalog.pg_authid IN ACCESS SHARE MODE
 
 
What I'm looking for is "inverse -b" in an otherwise complete dump. Any plans to add that?
 
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
 
Attachment

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Exclude pg_largeobject form pg_dump
Next
From: Adrian Klaver
Date:
Subject: Re: Exclude pg_largeobject form pg_dump