Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a9TET-0006U2-Bm for pgsql-admin@arkaria.postgresql.org; Thu, 17 Dec 2015 07:44:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a9TES-0007PK-Mm for pgsql-admin@arkaria.postgresql.org; Thu, 17 Dec 2015 07:44:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a9TER-0007On-OT for pgsql-admin@postgresql.org; Thu, 17 Dec 2015 07:44:11 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a9TEN-0004Bs-KJ for pgsql-admin@postgresql.org; Thu, 17 Dec 2015 07:44:11 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 086FE20A66 for ; Thu, 17 Dec 2015 02:44:06 -0500 (EST) Received: from web6 ([10.202.2.216]) by compute5.internal (MEProxy); Thu, 17 Dec 2015 02:44:06 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.fm; h= content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=DVn yHZ1YzeOrcO99tzBa5N9HlxA=; b=TJ7SW5viNyfkdKQOmW78OoQcUNGYqfSOnlu ViJiC7y4RPocqzB1UDE2pWIZ/m9xkpuIuX1pb/dXpAvPk3kyW2m9H/32QGxUse6u cT2WG9AhHgqQXYnDgfx5bnGx4q2up4Cw8n6xAO3z7mzXPsvzKlsk3qz8FaWybpJh RwhF/k0c= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=DVnyHZ1YzeOrcO99tzBa5N9HlxA=; b=m4gln 73PNrnCkusJX7w7DPUbUhAE8q2KQmBzl6vD969xkaPaP/5zYm2NsMSmTC9LR4DUc lwq2Fav6TpB3VsEHrt8oNzHENT0DQFVlpXvvqCPN5jNmu8pMqH21X8OfVcojBkSz LlJiE8mQnkXX4F3jJGpQ94d63NVJ02cmSCdJhU= Received: by web6.nyi.internal (Postfix, from userid 99) id CDC094204E; Thu, 17 Dec 2015 02:44:05 -0500 (EST) Message-Id: <1450338245.2626908.469822713.6C14EE8F@webmail.messagingengine.com> X-Sasl-Enc: dJrVu6BzsXfckneboOZ2+UQkmL5t9jVz1UdlOo1kw046 1450338245 From: CN To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-a93c17cb Subject: feature request: pg_restore renaming target schema Date: Thu, 17 Dec 2015 15:44:05 +0800 X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Hi! I need to restore one source schema to multiple target schema currently. For example, source database: db1 source schema: s1 target database: db2 The existing approach I know is following these steps: (1) pg_dump -n s1 -Fc -f source.db db1 (2a) pg_restore -d db2 -n s1 source.db (2b) psql -c "ALTER SCHEMA s1 RENAME TO t1" db2 (3a) pg_restore -d db2 -n s1 source.db (3b) psql -c "ALTER SCHEMA s1 RENAME TO t2" db2 So far so good. However, with existing tool I know, obviously step groups (2) and (3) can only run sequentially. If pg_restore allows "redirecting" source schema to target schema, then I can concurrently issue some imaginary commands like these: pg_restore -d db2 -n s1 --target-schema=t1 source.db pg_restore -d db2 -n s1 --target-schema=t2 source.db pg_restore -d db2 -n s1 --target-schema=t3 source.db Best Regards, CN -- http://www.fastmail.com - Faster than the air-speed velocity of an unladen european swallow -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin