pg_dump and drop table if exists statement

From: Ibrahim Harrani <ibrahim(dot)harrani(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: pg_dump and drop table if exists statement
Date: 2011-06-13 07:56:27
Message-ID: BANLkTim45-uyjEQR5nL9kRBn0D0c_sJf7g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

I am using PostgreSQL 9.0 I would like to dump some tables and all
functions,triggers on the database.
If I drop with pg_dump -c parameter, it removes public schema as
well. pg_dump -C parameter output has create table
but I can't restore this output directly(Because the tables are
already exist on the db)
There is no problem with functions. They have already this feature.

How can backup/restore tables with DROP TABLE IF EXISTS statement like
in MySQL? without dropping all database and create again?

Thanks in advance.

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Dai, Tino 2011-06-13 14:05:15 Postgresql 8.2, tsearch2
Previous Message Simon Riggs 2011-06-13 07:54:42 Re: Reindexing primary keys without locking