Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBu6x-0001QR-6e for pgsql-admin@arkaria.postgresql.org; Fri, 27 Apr 2018 03:31:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fBu6v-0007Ss-3U for pgsql-admin@arkaria.postgresql.org; Fri, 27 Apr 2018 03:31:49 +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.89) (envelope-from ) id 1fBu6u-0007Si-Q6 for pgsql-admin@lists.postgresql.org; Fri, 27 Apr 2018 03:31:48 +0000 Received: from mail-it0-x242.google.com ([2607:f8b0:4001:c0b::242]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fBu6n-0007O4-Mw for pgsql-admin@postgresql.org; Fri, 27 Apr 2018 03:31:48 +0000 Received: by mail-it0-x242.google.com with SMTP id e20-v6so288810itc.1 for ; Thu, 26 Apr 2018 20:31:40 -0700 (PDT) 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-language; bh=iWoZbZFUL6wqcAozQ6wVEuFdIq9qjkWhiLVC7mV6ICM=; b=n3pXgzPic3VYiiUrKb5/S1bw5QfBbiQXWi+x9OObOD3q+6pA1fj/lOAUN49SXy3PGM b+QYFYQLZLTTZA4MnxetlbR5A1wLsz3Jlrd5I7XJSLwdnf38JbLmto3rMrceFJ7572uW BpQuDlcaQx7lVzgvwYIEfkDZAs7m6hw2DNMyLF/oFTPch4EvMBjywgfe0rX4gCIFLZjG fDKqQ8x5K30UL7HwTlfWiyYB8gkdC36tcDVil05a4PPIZYvOcHrr42BlWrPzaAMyf/EN AYixo62cK/ANopmYDGYXgv0C7RBDyipS1rGkWzZ0QV58EYK1ND+/q+XSBX71GThPS14s vCXQ== 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-language; bh=iWoZbZFUL6wqcAozQ6wVEuFdIq9qjkWhiLVC7mV6ICM=; b=spXy6ZRODJCMR1fMQxjrv604mxvbEZUViePy1jfn5LpiYyS4TydwnaHt33hIFATxXP YI4grd7Yx5X4oOGKTp0NFe9aIFRE+nbd6JENdMWfAtW1lbKnwCRQludroO38sfpPsCyu puKi/ua1eAGnZe1R+WUiQZAlTuEykjZKWbPOKZEO4MrkOOCE6x2EVM+fvQq+ScGhSYL1 Tlum0D/GO4zdlnstZ+vna3A4ActnY3RmJMFJ3xyO3VldVxyJp0Am8UprbChbQZSjarUl 7gD/XJKUdg712LgkP/vzS/EDefMNDyeo5w5mi5//IjSex1TMD9zjNa09oGffnNyppn/z NXrQ== X-Gm-Message-State: ALQs6tDK2sXbDmj5mQ4QsE5dNYtn46lavyfcAaq37pZGCwpihz1RS9/5 P6CvTZm93dEuU8P2eyPg1aRlzg== X-Google-Smtp-Source: AB8JxZpEliDpNN4MfaxommUaLyZKM8hobnAl4mtVO7+jxcyP4/50D+L6k9sEA8vSv1gEdAEfvnZxvg== X-Received: by 2002:a24:72c5:: with SMTP id x188-v6mr312113itc.118.1524799899071; Thu, 26 Apr 2018 20:31:39 -0700 (PDT) Received: from [10.44.10.6] (ip-81-230-239-173.toronto.ca.northamericancoax.com. [173.239.230.81]) by smtp.googlemail.com with ESMTPSA id 2-v6sm119230itk.1.2018.04.26.20.31.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Apr 2018 20:31:38 -0700 (PDT) Subject: Re: pg_restore dumps all data to the terminal To: "pgsql-admin@postgresql.org" References: <64dded41-6355-683c-a9f6-9253cbefd4c7@gmail.com> From: Ron Message-ID: <294a1dab-5b5c-9cfb-330d-5e8c2dc05156@gmail.com> Date: Thu, 26 Apr 2018 22:31:37 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------4176F43984BC433E91300918" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------4176F43984BC433E91300918 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 04/26/2018 10:15 PM, David G. Johnston wrote: > On Thursday, April 26, 2018, Ron > wrote: > > Hi, > > v9.6.8, restoring from 8.4.17 > > This command dumps not just the schema to the terminal (technically, > nohup.out) but the actual data.  How do I stop that?  There's no > --quiet, and that's not what I want anyway... > > pg_restore -cC --if-exists -e -Fd -j4 ${SOURCE}/${DB} > > > "pg_restore can operate in two modes. If a database name is specified, > pg_restore connects to that database and restores archive contents > directly into the database. Otherwise, a script containing the SQL > commands necessary to rebuild the database is created and written to a > file or standard output." > > You haven't specified a database so you get the second mode. But the database doesn't exist.  If I have to explicitly create the DB beforehand, what's the purpose of the "--create" option? But... looking more carefully at the examples, I see that one must attach to the postgres db when you want pg_restore to create the database.  (That should be made clear in the --create section of the manual.) Thanks -- Angular momentum makes the world go 'round. --------------4176F43984BC433E91300918 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

On 04/26/2018 10:15 PM, David G. Johnston wrote:
On Thursday, April 26, 2018, Ron <ronljohnsonjr@gmail.com> wrote:
Hi,

v9.6.8, restoring from 8.4.17

This command dumps not just the schema to the terminal (technically, nohup.out) but the actual data.  How do I stop that?  There's no --quiet, and that's not what I want anyway...

pg_restore -cC --if-exists -e -Fd -j4 ${SOURCE}/${DB}


"pg_restore can operate in two modes. If a database name is specified, pg_restore connects to that database and restores archive contents directly into the database. Otherwise, a script containing the SQL commands necessary to rebuild the database is created and written to a file or standard output."

You haven't specified a database so you get the second mode.

But the database doesn't exist.  If I have to explicitly create the DB beforehand, what's the purpose of the "--create" option?

But... looking more carefully at the examples, I see that one must attach to the postgres db when you want pg_restore to create the database.  (That should be made clear in the --create section of the manual.)

Thanks

--
Angular momentum makes the world go 'round.
--------------4176F43984BC433E91300918--