Обсуждение: pg_dump: Exporting SQL and data for a schema ONLY??

Поиск
Список
Период
Сортировка

pg_dump: Exporting SQL and data for a schema ONLY??

От
Brian Huber
Дата:
Hello all -

Does anyone know if there is a way to export a schema
only using pg_dump (or otherwise)?

For example, if I have a database "test" that contains
three schemas "public", "schema1", and "schema2" - and
I want to export the SQL to re-create the tables and
the data for schema1 only - how would I do that?  If I
dump the test database, the schemas are mixed together
and is very cumbersome to extract out just one.

Any suggestions appreciated. Thanks...

BGH

Re: pg_dump: Exporting SQL and data for a schema ONLY??

От
Tom Lane
Дата:
Brian Huber <brianghuber@yahoo.com> writes:
> Does anyone know if there is a way to export a schema
> only using pg_dump (or otherwise)?

7.3's pg_dump does not have this feature, but it is in 7.4.

            regards, tom lane

Re: pg_dump: Exporting SQL and data for a schema ONLY??

От
"Anis W. Nugroho"
Дата:
Have you ever try
  pg_dump database_name -s

Cheers
Anis WN
________________________________
15 Mbytes Free Web-based and  POP3
Sign up now: http://www.gawab.com

Re: pg_dump: Exporting SQL and data for a schema ONLY??

От
"Anis W. Nugroho"
Дата:
Sorry...

I mean
  pg_dump database_name -t schema_name

 -s is for dumping the schema only (no data)

Anis WN
________________________________
15 Mbytes Free Web-based and  POP3
Sign up now: http://www.gawab.com