Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtEAZ-0008Oo-ER for pgsql-general@arkaria.postgresql.org; Mon, 11 Feb 2019 16:10:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gtEAY-0001VT-6F for pgsql-general@arkaria.postgresql.org; Mon, 11 Feb 2019 16:10:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtEAX-0001VM-On for pgsql-general@lists.postgresql.org; Mon, 11 Feb 2019 16:10:53 +0000 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtEAV-0006Lp-DJ for pgsql-general@lists.postgresql.org; Mon, 11 Feb 2019 16:10:52 +0000 Received: by mail-ot1-x329.google.com with SMTP id b3so2210285otp.4 for ; Mon, 11 Feb 2019 08:10:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=70y9bERkf5gYvK7pzmtilERWNN7i7CVe6syUg3+j6a4=; b=Z42MpvCr82YHZ6EcGpbyX5FGp+fTPSO0QkX5oFMpdTGq3kRtplxmj8kc/9T6zfy0fb mnFK+Vl445q1bUTqvBoGMD40mR329FyIa1vg7M4SrM9kO6Jc5yTQ+mZvr6uB+4HlsZ1v 1OX9Lf2lqurh7XuXgVOBZ2U9y50tCcPUA5I5FEPFeySSesuSCDEXsbv58NKOc7PMjvAV aDU+hF13E3PcTLx+NFrsSs3KOlb8KSULiRQxe7T71ufRvf/ZYwYxD5mLtz4/l4VRAz9D 0E5qiOoz1S8q2tjN70jxtuzupRseLQfFcVRt46BaIfRDZIX8LXqnoDAnEOAh4KXfX2MV fGMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=70y9bERkf5gYvK7pzmtilERWNN7i7CVe6syUg3+j6a4=; b=ukBcqQH2ynC0ronflt2OdZn+OMgjXwXVQbKbgSVsuL5co9ks0v5bdg/xrNm4WSYLEv Me2eMTr40DT2pQTEKXZ+H521RAgW4XZVxt5JzcyOCYVJTui/N+g+UL4NJrBNK80sQ420 CwHyGxKgOWY1Hg7Bii1GYY4CgB7sYIszOR+qzEkC5/R8k4H536DWeTEQCUgtw41jw5df Dr1uSSaAaKvdnGueeit/WMFxW7OcmYS4txW4UOAYXpXSScRHMgjRASgErgExe4/rqZ+U RXw/FF4QhPt6pBZH4IbywxtH/jmeZv8xi7Y3TaCKTLN2JmSo89W/0Gc0b3ceTVFgZpA+ yZgg== X-Gm-Message-State: AHQUAuanKfd8MlTiuc9mkATmQW9lmrFAdlMuTt98EBRCzWeftUNYssz/ 97rk1zNzwPDSbYG5gwU8Mqo+qBsR X-Google-Smtp-Source: AHgI3IbhLLWzTV/H75elqsuozU6n2ILsuKXqAQT/80bJuKaKtJT58F32rinS4THYg123buIuRqRy3Q== X-Received: by 2002:a9d:19a8:: with SMTP id k37mr29776248otk.283.1549901450173; Mon, 11 Feb 2019 08:10:50 -0800 (PST) Received: from [192.168.1.10] (ip70-171-116-89.no.no.cox.net. [70.171.116.89]) by smtp.googlemail.com with ESMTPSA id j1sm4516706otl.43.2019.02.11.08.10.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Feb 2019 08:10:49 -0800 (PST) Subject: Re: Copy entire schema A to a different schema B To: pgsql-general@lists.postgresql.org References: From: Ron Message-ID: <9aa9cb06-8bca-910c-5251-d974849dda7c@gmail.com> Date: Mon, 11 Feb 2019 10:10:48 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2/11/19 10:00 AM, Tiffany Thang wrote: > Hi, > To copy the source schema A to target schema B in the same database in > PG10.3, I use psql to dump schema A and manually removes anything specific > to the schema in the text dump file before importing into schema B. How do > I achieve the same exporting from Schema A and importing into schema B > using pg_dump with the -Fc option? Since the dump file generated is > binary, I could not make modifications to the file. Is the procedure the > same in version 11? Why do you need to use "--format=custom" instead of "--format=plain"? For example: $ pg_dump --format=plain --schema-only --schema=A -- Angular momentum makes the world go 'round.