Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id D6AC5B5DBBE for ; Mon, 13 Jun 2011 04:56:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 99102-04 for ; Mon, 13 Jun 2011 07:56:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iw0-f174.google.com (mail-iw0-f174.google.com [209.85.214.174]) by mail.postgresql.org (Postfix) with ESMTP id E60EBB5D80A for ; Mon, 13 Jun 2011 04:56:27 -0300 (ADT) Received: by iwn34 with SMTP id 34so3612891iwn.19 for ; Mon, 13 Jun 2011 00:56:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=ymcTm6xgjevAQ4vteezOcIxe2r14+6CTKkR2fQwCtJY=; b=R5jaypgC3Ll/dJjPIR89GC3KC2qHW1fc/ZzEaYus4RA/DsaBBvQ/Ge7d1PN4dvu9yX MoL24vW7vcbWTnTOiVEv6qv0TzbGVFClS/6Om8ILJQJTQ0KJPASk70TxcrEQ9S3H9J6f GcNU7gGQs541JT1wB1QsiVQ+AjSJjq0BSqTWI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=XCigZmYHlz63A9o1roe5mfk3te8TcWe4DffzM/xLPDGOdYcKjQTPxoPexvRVRs8K/6 BmdUdB2GgD4KBNFc/L2nSfCpalkf80q7gwu/XHw+30/FFVrucdgjOfx7NSBh2G2tvB1e l9tUpOtvAz2w2705088RQviNVlCcf0rBiWNn4= MIME-Version: 1.0 Received: by 10.42.144.70 with SMTP id a6mr6286418icv.486.1307951787702; Mon, 13 Jun 2011 00:56:27 -0700 (PDT) Received: by 10.42.197.69 with HTTP; Mon, 13 Jun 2011 00:56:27 -0700 (PDT) Date: Mon, 13 Jun 2011 10:56:27 +0300 Message-ID: Subject: pg_dump and drop table if exists statement From: Ibrahim Harrani To: pgsql-admin@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.888 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201106/57 X-Sequence-Number: 37683 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.