postgresql/src/backend
Michael Paquier 4c9c359d38 Refactor code in tablecmds.c to check and process tablespace moves
Two code paths of tablecmds.c (for relations with storage and without
storage) use the same logic to check if the move of a relation to a
new tablespace is allowed or not and to update pg_class.reltablespace
and pg_class.relfilenode.

A potential TABLESPACE clause for REINDEX, CLUSTER and VACUUM FULL needs
similar checks to make sure that nothing is moved around in illegal ways
(no mapped relations, shared relations only in pg_global, no move of
temp tables owned by other backends).

This reorganizes the existing code of ALTER TABLE so as all this logic
is controlled by two new routines that can be reused for the other
commands able to move relations across tablespaces, limiting the number
of code paths in need of the same protections.  This also removes some
code that was duplicated for tables with and without storage for ALTER
TABLE.

Author: Alexey Kondratov, Michael Paquier
Discussion: https://postgr.es/m/YA+9mAMWYLXJMVPL@paquier.xyz
2021-01-27 11:54:16 +09:00
..
access Remove CheckpointLock. 2021-01-25 12:34:38 -05:00
bootstrap Update copyright for 2021 2021-01-02 13:06:25 -05:00
catalog Fix ALTER DEFAULT PRIVILEGES with duplicated objects 2021-01-20 11:38:17 +09:00
commands Refactor code in tablecmds.c to check and process tablespace moves 2021-01-27 11:54:16 +09:00
executor Rethink recently-added SPI interfaces. 2021-01-26 16:37:12 -05:00
foreign Update copyright for 2021 2021-01-02 13:06:25 -05:00
jit Update copyright for 2021 2021-01-02 13:06:25 -05:00
lib Update copyright for 2021 2021-01-02 13:06:25 -05:00
libpq Move SSL information callback earlier to capture more information 2021-01-22 09:26:27 +09:00
main Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodes Implement support for bulk inserts in postgres_fdw 2021-01-20 23:57:27 +01:00
optimizer Fix pull_varnos' miscomputation of relids set for a PlaceHolderVar. 2021-01-21 15:37:23 -05:00
parser Re-allow DISTINCT in pl/pgsql expressions. 2021-01-22 16:26:22 -05:00
partitioning Update copyright for 2021 2021-01-02 13:06:25 -05:00
po Translation updates 2020-05-18 12:49:30 +02:00
port Update copyright for 2021 2021-01-02 13:06:25 -05:00
postmaster Add pg_stat_database counters for sessions and session time 2021-01-17 13:52:31 +01:00
regex Fix ancient bug in parsing of BRE-mode regular expressions. 2021-01-08 12:16:00 -05:00
replication Fix two typos in snapbuild.c. 2021-01-25 12:15:10 -08:00
rewrite Update copyright for 2021 2021-01-02 13:06:25 -05:00
snowball Update copyright for 2021 2021-01-02 13:06:25 -05:00
statistics Update copyright for 2021 2021-01-02 13:06:25 -05:00
storage Remove CheckpointLock. 2021-01-25 12:34:38 -05:00
tcop Improve performance of repeated CALLs within plpgsql procedures. 2021-01-25 22:28:29 -05:00
tsearch Update copyright for 2021 2021-01-02 13:06:25 -05:00
utils Improve performance of repeated CALLs within plpgsql procedures. 2021-01-25 22:28:29 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Update copyright for 2021 2021-01-02 13:06:25 -05:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Add missing gettext triggers 2020-04-28 13:35:40 +02:00