Re: Tablespace column value null on select * from pg_tables

2019-07-28 Thread Adrian Klaver
On 7/28/19 1:24 PM, Peter J. Holzer wrote: On 2019-07-16 19:20:24 +, Alex Williams wrote: 1. postgres=# ALTER DATABASE mydatabase SET TABLESPACE pg_default; ERROR: some relations of database "mydatabase" are already in tablespace "pg_default" HINT: You must move them back to the databas

Re: Tablespace column value null on select * from pg_tables

2019-07-28 Thread Tom Lane
"Peter J. Holzer" writes: > On 2019-07-16 19:20:24 +, Alex Williams wrote: >> 1. postgres=# ALTER DATABASE mydatabase SET TABLESPACE pg_default; >> ERROR: some relations of database "mydatabase" are already in tablespace >> "pg_default" >> HINT: You must move them back to the database's def

Re: Tablespace column value null on select * from pg_tables

2019-07-28 Thread Peter J. Holzer
On 2019-07-16 19:20:24 +, Alex Williams wrote: > 1. postgres=# ALTER DATABASE mydatabase SET TABLESPACE pg_default; > > ERROR: some relations of database "mydatabase" are already in tablespace > "pg_default" > > HINT: You must move them back to the database's default tablespace before > u

Re: Tablespace column value null on select * from pg_tables

2019-07-16 Thread Alex Williams
Hi Thomas and Adrian, I'm sorry on my part, you both are correct, thanks again for your help. What I did today that worked to move everything from data2 to pg_default was: 1. postgres=# ALTER DATABASE mydatabase SET TABLESPACE pg_default; ERROR: some relations of database "mydatabase" are alre

Re: Tablespace column value null on select * from pg_tables

2019-07-15 Thread Adrian Klaver
On 7/15/19 12:53 PM, Alex Williams wrote: Hi Adrian, "Not if you did: CREATE DATABASE name ... [ TABLESPACE [=] tablespace_name ] ALTER DATABASE name SET TABLESPACE new_tablespace This makes the tablespace the default for the database and the default shows up as null in pg_tables: https://www

Re: Tablespace column value null on select * from pg_tables

2019-07-15 Thread Thomas Kellerer
Alex Williams schrieb am 15.07.2019 um 20:35: But in my case, I have a database that's in a user-defined tablespace (data2) and all the tables/indexes there are also in data2 and I want to do a select into a table the results of all the tables / tablespaces they are in that database...when doing

Re: Tablespace column value null on select * from pg_tables

2019-07-15 Thread Alex Williams
Hi Adrian, "Not if you did: CREATE DATABASE name ... [ TABLESPACE [=] tablespace_name ] ALTER DATABASE name SET TABLESPACE new_tablespace This makes the tablespace the default for the database and the default shows up as null in pg_tables: https://www.postgresql.org/docs/9.5/view-pg-tables.html

Re: Tablespace column value null on select * from pg_tables

2019-07-15 Thread Adrian Klaver
On 7/15/19 11:35 AM, Alex Williams wrote: Hi, Server Version 9.5 I found this old thread on something similar to the results I'm getting: https://www.postgresql.org/message-id/1308615192339-4508750.post%40n5.nabble.com But in my case, I have a database that's in a user-defined tablespace (d