Re: Restoring a database restores to unexpected tablespace

2019-07-10 Thread Alex Williams
Thanks Tom and Ian, Tom, I wasn't sure if that would work (-c), so I just tried assuming it would throw an error, but it didn't so I assumed it worked until I started checking the tables and noticed it was still being created on data2. I tried originally with just -f, but that didn't work so I

Re: Restoring a database restores to unexpected tablespace

2019-07-10 Thread Tom Lane
Ian Barwick 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

Re: Restoring a database restores to unexpected tablespace

2019-07-09 Thread Ian Barwick
On 7/10/19 2:56 AM, Alex Williams wrote: Hi, Can someone point me in the right direction for this issue we are having -- our goal is to dump a database that is currently on a tablespace named data2 that we want to restore on the same server but on tablespace pg_default -- we tried other ways

Restoring a database restores to unexpected tablespace

2019-07-09 Thread Alex Williams
Hi, Can someone point me in the right direction for this issue we are having -- our goal is to dump a database that is currently on a tablespace named data2 that we want to restore on the same server but on tablespace pg_default -- we tried other ways like: ALTER DATABASE "[database_name]" SET