Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jv6Rd-0003Ns-9c for pgsql-general@arkaria.postgresql.org; Mon, 13 Jul 2020 21:57:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jv6R4-0001A1-F2 for pgsql-general@arkaria.postgresql.org; Mon, 13 Jul 2020 21:56:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jv6R4-00019u-5O for pgsql-general@lists.postgresql.org; Mon, 13 Jul 2020 21:56:30 +0000 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jv6R0-0006w1-5n for pgsql-general@lists.postgresql.org; Mon, 13 Jul 2020 21:56:28 +0000 Received: by mail-oi1-x242.google.com with SMTP id l63so12261913oih.13 for ; Mon, 13 Jul 2020 14:56:25 -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-transfer-encoding:content-language; bh=BYJnB6PCY1a14raEeGOEKrKQkNRE/HT/U1A9Afn5ZtA=; b=FQXZh0KT5vaS/bsewrky7R/9xQQRbF7uzgf87yUKeochVMVlG+aB+BbfnILps9v76D V0g8CiMkvwR9w2pBXeFvWjgGtzQRsyX15eJ1XB9NRWW+vcgopa8sXSvmDzV530TmzyBw klpxlAK0vm2xmDttZ4dHbM6KOZGQwcqz+KqMJ+Ns2jNoQUtideWOTWlallMBZDqah68q omnJQCo2nWP2UKUNfFo7298pv5HxHj68hiHnL8ZsQb0mPkGERuD/deME9c3M8Yxym2rA p3DLDafzT6Ollvd7+32yn6ZmBoxfVMMg/vbgC7MwXlviZ29qgW3BXaf8nWuieo7uTWlW NB/w== 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=BYJnB6PCY1a14raEeGOEKrKQkNRE/HT/U1A9Afn5ZtA=; b=RVGuX8QXKNFgwens3OJwExV4AOLcA2LHfPQWgbkOw2AFT1afOPdkP+YZGazmFDviJv Mi7d1RUMYbAZWnA8oDtgQjDCYUAfm2HjS9iU2P7UKI9otR8UK0hvg9qYlYJ2onzEQJrZ 0ssfHhdLaN7TyQyic6u7/x8JZTKFoOkevkTySqwtoi6ZB++hm4PdXBswhwogGEZ/Md7V huqt7sen49uEjD6J7XctrQjEaZHpCIHdG2nUyyecK2tM9wpO33XTwqkCJEPmDfxs3cdS wQhLpNibKr2gUoVKZKfstDIkmNatyaJ+zpDjOQf6tWxblecLA11CzUIN87BXwgFiiHK9 yiUQ== X-Gm-Message-State: AOAM533oyd7zr5sjBeTyNlPvX3OAdcj9e0K+bvcnTlwvYFE9L5ZuJTWs f/BzTYqGrtdHYtZz+h/CzKaNX/kSZwemzw== X-Google-Smtp-Source: ABdhPJxK1tgswH0R4fLap0w+c60UyR8tBbc/Oe9MGBCdVfUduhikAe2g3ugwRl2Xx4W2hD89FxNMyA== X-Received: by 2002:aca:4a43:: with SMTP id x64mr1295768oia.171.1594677384811; Mon, 13 Jul 2020 14:56:24 -0700 (PDT) Received: from [192.168.1.10] (ip70-186-126-197.no.no.cox.net. [70.186.126.197]) by smtp.googlemail.com with ESMTPSA id v63sm3002012oie.2.2020.07.13.14.56.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Jul 2020 14:56:24 -0700 (PDT) Subject: Re: backup -restore question To: pgsql-general@lists.postgresql.org References: <97dbd799-7a6c-d0bc-deb2-fd56d3cda7a9@aklaver.com> From: Ron Message-ID: <4e073ca3-9813-0fdb-a31e-4bb55efd4dd5@gmail.com> Date: Mon, 13 Jul 2020 16:56:22 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <97dbd799-7a6c-d0bc-deb2-fd56d3cda7a9@aklaver.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 7/13/20 2:32 PM, Adrian Klaver wrote: > On 7/13/20 12:12 PM, Julie Nishimura wrote: >> Hello there, >> One of our PostgreSQL 9.4.1  databases has been backed up as *.gz file >> with the compression 9 "pg_dump -Z 9". What is the right format of >> restore this file when needed? Can I run the restore from a compressed >> file or I need to unzip the file first, then run pg_restore? Thanks > > It depends on whether you dumped using the custom format -Fc or plain(no > -F or -Fp). If the custom format then you run pg_restore against it. If > the plain format then you will to unzip first then feed the file to psql. What about this? gunzip -c | foo.sql.gz | psql -- Angular momentum makes the world go 'round.