postgresql/src
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
..
backend Refactor code in tablecmds.c to check and process tablespace moves 2021-01-27 11:54:16 +09:00
bin Code review for psql's helpSQL() function. 2021-01-26 13:04:52 -05:00
common Introduce SHA1 implementations in the cryptohash infrastructure 2021-01-23 11:33:04 +09:00
fe_utils Update copyright for 2021 2021-01-02 13:06:25 -05:00
include Refactor code in tablecmds.c to check and process tablespace moves 2021-01-27 11:54:16 +09:00
interfaces Remove duplicate include 2021-01-25 08:55:43 +01:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl Rethink recently-added SPI interfaces. 2021-01-26 16:37:12 -05:00
port Move our p{read,write}v replacements into their own files. 2021-01-14 11:16:59 +13:00
template Further tweaking of PG_SYSROOT heuristics for macOS. 2021-01-20 12:07:23 -05:00
test Don't clobber the calling user's credentials cache in Kerberos test. 2021-01-25 14:53:13 -05:00
timezone Update time zone data files to tzdata release 2021a. 2021-01-24 16:29:47 -05:00
tools Remove make_diff set of tools 2021-01-24 14:19:00 +01:00
tutorial Doc, more or less: uncomment tutorial example that was fixed long ago. 2021-01-13 16:00:03 -05:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Introduce SHA1 implementations in the cryptohash infrastructure 2021-01-23 11:33:04 +09:00
Makefile.shlib Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00