pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Refactor code in tablecmds.c to check and process tablespace mov
Date: Wed, 27 Jan 2021 11:07:41 -0300
Message-ID: <20210127140741.GA14174@alvherre.pgsql> (raw)
In-Reply-To: <E1l4az0-0000uQ-Mz@gemulon.postgresql.org>

On 2021-Jan-27, Michael Paquier wrote:

> Refactor code in tablecmds.c to check and process tablespace moves

Thanks, looks good.  Small comment: CheckRelationTableSpaceMove is
documented as

+ * Returns true if the relation can be moved to the new tablespace;
+ * false otherwise.

but in reality it returns false if the relation does not *need* to be
moved because the tablespace is the same as before.  In the cases where
it "cannot" be moved, what it does is raise an error.

Maybe this needs is just be documented more clearly:

"Returns true if the relation can be moved to the new tablespace; raises
an error if it is not possible to do the move; returns false if the move
would have no effect."


For cases of relation with storage, I find it suspicious that the
functions are documented to be fine with just ShareUpdateExclusiveLock.
I think it'd be safer for the comment to explicitly indicate that for
relations with storage, lock should be AEL.

-- 
Álvaro Herrera                            39°49'30"S 73°17'W





view thread (5+ messages)  latest in thread

Message-ID: <20210127140741.GA14174@alvherre.pgsql>
Permalink:  ../20210127140741.GA14174@alvherre.pgsql/
Also on:    postgresql.org/message-id/20210127140741.GA14174@alvherre.pgsql

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Refactor code in tablecmds.c to check and process tablespace mov
  In-Reply-To: <20210127140741.GA14174@alvherre.pgsql>

* 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