Re: Pg_dump and bytaA

From: "Milen A(dot) Radev" <milen(at)radev(dot)net>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Pg_dump and bytaA
Date: 2007-03-09 14:42:42
Message-ID: esrrp4$t6h$1@sea.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-novice

Lukas wrote:
> -b
> --blobs
> Include large objects in dump.
>
> Examples
>
> To dump a database:
> $ pg_dump mydb > db.out
>
> To dump a database called mydb that contains large objects to a tar file:
> $ pg_dump -Ft -b mydb > db.tar

Please read what I've written. This was the case up to version 8.0.
After it the large objects are *always* included in the custom/tar type
dumps. So no need for "-b/--blobs" *but* you have no way to exclude them
. In the docs for pg_dump for versions after 8.1 the large objects are
not even mentioned.

>
>> Achilleas Mantzios wrote:
>>> Στις Παρασκευή 09 Μάρτιος 2007 15:05, ο/η Milen A.
>>> Radev έγραψε:
>>>> Achilleas Mantzios wrote:
>>>>> Στις Παρασκευή 09 Μάρτιος 2007 11:00, ο/η Lukas
>>>>> έγραψε:
>>>>>> Hello,
>>>>>>
>>>>>> pg_dump can avoid bloob fields (it can dumb without blobs), but as I
>>>>>> understand byteA is not bloob, so in this case what is blob? I did
>>>>>> not
>>>>>> found such type as blob..
>>>>> Take a look at
>>>>> http://www.postgresql.org/docs/7.4/interactive/largeobjects.html
>>>>>
>>>>> You might also consider writing a program for transforming your db/app
>>>>> from bytea based to large object based, and simply exclude blobs
>>>>> from your pg_dump's.
>>>> How to exclude them from a custom dump? (That's for version 8.1/8.2)
>>> you just dont include them :)
>> Yes, and how exactly you do not include them?
>>
>> For example - this is my backup script that is executed nightly:
>>
>> -------------------------------------------------------------------
>> PSQL=/usr/local/pgsql/bin/psql
>> PG_DUMP=/usr/local/pgsql/bin/pg_dump
>> PG_DUMPALL=/usr/local/pgsql/bin/pg_dumpall
>>
>>
>> $PG_DUMPALL -U postgres --globals-only > $BACKUPDIR/pg_globals.sql
>>
>> for db in `$PSQL -U postgres -d template1 -t -c "SELECT datname FROM
>> pg_catalog.pg_database WHERE datname "\!"~ 'template(0|1)';"`
>> do
>> echo -n -e "Dumping database $db...\t\t"
>> $PG_DUMP -U postgres --format=c $db > $BACKUPDIR/$db.dump
>> echo "done."
>> done
>> -------------------------------------------------------------------
>>
>> Guess what? There was a special command-line parameter for including
>> large objects in the custom/tar dump until version 8.1
>> (http://www.postgresql.org/docs/8.0/static/app-pgdump.html, look for
>> "--blobs"). Now they are included by default AND could not be excluded,
>> at least I could not find a way to do that
>> (http://www.postgresql.org/docs/8.1/static/app-pgdump.html).
>>
>> So what are you suggesting?

--
Milen A. Radev

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Milen A. Radev 2007-03-09 14:47:25 Re: Pg_dump and bytaA
Previous Message Lukas 2007-03-09 14:27:03 Re: Pg_dump and bytaA

Browse pgsql-novice by date

  From Date Subject
Next Message Bruno Wolff III 2007-03-09 14:45:50 Re: Help with creating Documentation
Previous Message Lukas 2007-03-09 14:27:03 Re: Pg_dump and bytaA