Re: Restoring a database restores to unexpected tablespace

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ian Barwick <ian(dot)barwick(at)2ndquadrant(dot)com>
Cc: Alex Williams <valenceshell(at)protonmail(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Restoring a database restores to unexpected tablespace
Date: 2019-07-10 14:20:30
Message-ID: 16457.1562768430@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ian Barwick <ian(dot)barwick(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-07-10 14:27:00 Re: execute_values
Previous Message Weatherby,Gerard 2019-07-10 12:09:52 Re: execute_values