Re: Exclude pg_largeobject form pg_dump

From: Andreas Joseph Krogh <andreas(at)visena(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Exclude pg_largeobject form pg_dump
Date: 2016-03-08 15:58:07
Message-ID: VisenaEmail.57.8131aff25e7bb811.15356f25889@tc7-visena
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

På tirsdag 08. mars 2016 kl. 16:54:19, skrev Adrian Klaver <
adrian(dot)klaver(at)aklaver(dot)com <mailto:adrian(dot)klaver(at)aklaver(dot)com>>:
On 03/08/2016 07:46 AM, Andreas Joseph Krogh wrote:
> På tirsdag 08. mars 2016 kl. 16:30:36, skrev Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us
> <mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us>>:
>
>     Andreas Joseph Krogh <andreas(at)visena(dot)com> writes:
>      > P�� tirsdag 08. mars 2016 kl. 15:43:37, skrev Adrian Klaver <
>      > adrian(dot)klaver(at)aklaver(dot)com <mailto:adrian(dot)klaver(at)aklaver(dot)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

Off hand I would say you are running pg_dump as a user that is not a
superuser:
[snip]
 
Yes, since when should I not be able to dump a DB (owned by a non-superuser)
as that user?
 
-- Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
andreas(at)visena(dot)com <mailto:andreas(at)visena(dot)com>
www.visena.com <https://www.visena.com>
<https://www.visena.com>

 

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Joseph Krogh 2016-03-08 16:02:45 Re: Exclude pg_largeobject form pg_dump
Previous Message Tom Lane 2016-03-08 15:57:01 Re: Exclude pg_largeobject form pg_dump

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Joseph Krogh 2016-03-08 16:02:45 Re: Exclude pg_largeobject form pg_dump
Previous Message Stephen Frost 2016-03-08 15:57:29 Re: Odd warning from pg_dump