Re: How can I pg_dump certain tables in the database?

Поиск
Список
Период
Сортировка
От Don Saxton
Тема Re: How can I pg_dump certain tables in the database?
Дата
Msg-id 052401c19636$b14a9520$3225aa40@pacbell.net
обсуждение исходный текст
Ответ на How can I pg_dump certain tables in the database?  ("Jeff Lu" <jklcom@mindspring.com>)
Список pgsql-cygwin
Of course each case may vary, but below is what I just did as an example.The
maddening thing is that the docs on backup and restore are so stark. how to
prove that you have a complete backup? possibly the only way at this point
is to restore to a new db and backup that to compare the two backup files.
until I can do that pg_dump is an act of faith. The 7.2 doc is better
http://candle.pha.pa.us/main/writings/pgsql/sgml/app-pgdump.html

pg_dump -Ft -b -o gbap | gzip > gbap.gz
where
-Ft =  format is like a tar
-b = backup the large objects (like text, blob, clob)  (ask: if I didn't
want them, Why would I put them in?)
-o keep the oids because I have foreign keys (see note )
gbap = name of my data base
| gzip = feed it as standard out to gzip for compression
> gbap.gz  = name of backup file

supposedly this can be restored to a new database as so

createdb gbap
gunzip -c gbap.gz | psql gbap

This makes sense because if you look at the resulting dump file it is the
sql statements you would need to create everything from scratch and psql
would accept and execute such sql.

backup and restore of a single table apparently requires custom and not tar
format so -Fc. Use --table=tableName to backup a single table.
I assume restoring a single table is then selecting it from the zip
I do not know what magic is in "custom format" that particularly allows this

note on oids and the -o option: I may be using this out of paranoia rather
than practicality. I have Foreign keys which the docs say requires -o, but I
don't see the FKs that I use as needing oid.again to test this out takes
time.


----- Original Message -----
From: "Jeff Lu" <jklcom@mindspring.com>
To: <pgsql-cygwin@postgresql.org>
Sent: Friday, January 04, 2002 7:38 PM
Subject: [CYGWIN] How can I pg_dump certain tables in the database?


> What is the syntax for pg_dump a table in a database?
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster


В списке pgsql-cygwin по дате отправления:

Предыдущее
От: "Hero"
Дата:
Сообщение: Re: startup failed! fatal error
Следующее
От: "Jakob Lund"
Дата:
Сообщение: Re: postgresql client under win 2k