Search Postgresql Archives

Re: Exclude pg_largeobject form pg_dump

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/08/2016 07:46 AM, Andreas Joseph Krogh wrote:
På tirsdag 08. mars 2016 kl. 16:30:36, skrev Tom Lane <tgl@xxxxxxxxxxxxx
<mailto:tgl@xxxxxxxxxxxxx>>:

    Andreas Joseph Krogh <andreas@xxxxxxxxxx> writes:
     > P�� tirsdag 08. mars 2016 kl. 15:43:37, skrev Adrian Klaver <
     > adrian.klaver@xxxxxxxxxxx <mailto:adrian.klaver@xxxxxxxxxxx>>:
     >  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:

aklaver@panda:~> pg_dump -v -d test -U aklaver -t '*'
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


aklaver@panda:~> pg_dump -v -d test -U postgres -t '*'
pg_dump: reading extensions
pg_dump: identifying extension members
pg_dump: reading schemas
pg_dump: reading user-defined tables
pg_dump: reading user-defined functions
pg_dump: reading user-defined types
pg_dump: reading procedural languages
pg_dump: reading user-defined aggregate functions
pg_dump: reading user-defined operators
pg_dump: reading user-defined operator classes
pg_dump: reading user-defined operator families
pg_dump: reading user-defined text search parsers
pg_dump: reading user-defined text search templates
pg_dump: reading user-defined text search dictionaries
....


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
andreas@xxxxxxxxxx <mailto:andreas@xxxxxxxxxx>
www.visena.com <https://www.visena.com>
<https://www.visena.com>


--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux