pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ian Barwick <ian.barwick@2ndquadrant.com>
Cc: Alex Williams <valenceshell@protonmail.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Restoring a database restores to unexpected tablespace
Date: Wed, 10 Jul 2019 10:20:30 -0400
Message-ID: <16457.1562768430@sss.pgh.pa.us> (raw)
In-Reply-To: <7fd8069f-a236-4e79-477c-7313ee416407@2ndquadrant.com>
References: <3YfH9uVTAd1a1GSxv8H2_mH4sPz_2a3NJgufLpjuMnMsIHd0P3uZ7GWFOD_Q9zgbX_ruyFPaRwdLw7Jncd5b7MokLdHYQMyogrhAIqnBR2o=@protonmail.com>
	<7fd8069f-a236-4e79-477c-7313ee416407@2ndquadrant.com>

Ian Barwick <ian.barwick@2ndquadrant.com> writes:
> On 7/10/19 2:56 AM, Alex Williams wrote:
>> 3. Restore the database with this command:
>> zcat /var/backup/db/mydatabase.gz |         sudo -H -u postgres         psql --quiet -e -c 'SET default_tablespace = pg_default;' -f - mydatabase_test > /tmp/mydatabase_test.log

> This should work.

Yeah, on modern PG.  But I think psql didn't support combinations of
-c and -f switches until 9.6.  9.5 would simply have dropped that -c
switch.

			regards, tom lane





view thread (4+ messages)  latest in thread

Message-ID: <16457.1562768430@sss.pgh.pa.us>
Permalink:  ../16457.1562768430@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16457.1562768430@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ian.barwick@2ndquadrant.com, valenceshell@protonmail.com
  Subject: Re: Restoring a database restores to unexpected tablespace
  In-Reply-To: <16457.1562768430@sss.pgh.pa.us>
  References: <3YfH9uVTAd1a1GSxv8H2_mH4sPz_2a3NJgufLpjuMnMsIHd0P3uZ7GWFOD_Q9zgbX_ruyFPaRwdLw7Jncd5b7MokLdHYQMyogrhAIqnBR2o=@protonmail.com> <7fd8069f-a236-4e79-477c-7313ee416407@2ndquadrant.com> <16457.1562768430@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox