pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: Tablespace column value null on select * from pg_tables
Date: Sun, 28 Jul 2019 13:45:42 -0700
Message-ID: <d53b3e96-9005-57dc-dc49-439c1b9d72f0@aklaver.com> (raw)
In-Reply-To: <20190728202439.GB25242@hjp.at>
References: <HF3MoPAEJHO5WGoMH1JsvhqzV3P48GQ8vOwKhad1xCLbC5-SOgGYDSmEOJFtFNARBPreyEGiuWKaI3pU2j8n7NG8kMDS41elKfD_qxB-AxY=@protonmail.com>
	<a61ac18f-df1b-1bb5-ca3c-346bc8faf464@aklaver.com>
	<KTdw5h9qQtntMgkqVtOrCx78JzBxXVMj0to5vT5B_yYZawT3I4vJ5dorf_gyFfreEps-6VspOhn-__EwrV_dD5-3yhhe0kIC5EtiWtknuXw=@protonmail.com>
	<6b86387c-1076-8c0e-564b-cd76d34c3132@aklaver.com>
	<98-GCV7Md7B0jENT-tVKpjarGkevVihM4OUhRpEbGUov3f2BKUDUpQR1725CegOBxE3oVEahOf1Ty0DR6anUAqbvIfI2FavO1LIRfpzyReg=@protonmail.com>
	<20190728202439.GB25242@hjp.at>

On 7/28/19 1:24 PM, Peter J. Holzer wrote:
> On 2019-07-16 19:20:24 +0000, 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 using this command.
> 
> What's the reason for this error? Wouldn't it be simpler to leave
> relations alone which are already in the correct tablespace?

~/src/backend/commands/dbcommands.c

  /*
* Check for existence of files in the target directory, i.e., objects of
* this database that are already in the target tablespace.  We can't
* allow the move in such a case, because we would need to change those
* relations' pg_class.reltablespace entries to zero, and we don't have
* access to the DB's pg_class to do so.
*/



> 
>          hp
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (9+ messages)

Message-ID: <d53b3e96-9005-57dc-dc49-439c1b9d72f0@aklaver.com>
Permalink:  ../d53b3e96-9005-57dc-dc49-439c1b9d72f0@aklaver.com/
Also on:    postgresql.org/message-id/d53b3e96-9005-57dc-dc49-439c1b9d72f0@aklaver.com

 · 

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: adrian.klaver@aklaver.com, hjp-pgsql@hjp.at
  Subject: Re: Tablespace column value null on select * from pg_tables
  In-Reply-To: <d53b3e96-9005-57dc-dc49-439c1b9d72f0@aklaver.com>
  References: <HF3MoPAEJHO5WGoMH1JsvhqzV3P48GQ8vOwKhad1xCLbC5-SOgGYDSmEOJFtFNARBPreyEGiuWKaI3pU2j8n7NG8kMDS41elKfD_qxB-AxY=@protonmail.com> <a61ac18f-df1b-1bb5-ca3c-346bc8faf464@aklaver.com> <KTdw5h9qQtntMgkqVtOrCx78JzBxXVMj0to5vT5B_yYZawT3I4vJ5dorf_gyFfreEps-6VspOhn-__EwrV_dD5-3yhhe0kIC5EtiWtknuXw=@protonmail.com> <6b86387c-1076-8c0e-564b-cd76d34c3132@aklaver.com> <98-GCV7Md7B0jENT-tVKpjarGkevVihM4OUhRpEbGUov3f2BKUDUpQR1725CegOBxE3oVEahOf1Ty0DR6anUAqbvIfI2FavO1LIRfpzyReg=@protonmail.com> <20190728202439.GB25242@hjp.at> <d53b3e96-9005-57dc-dc49-439c1b9d72f0@aklaver.com>

* 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