postgresql/src/backend/commands
Alexander Korotkov 885742b9f8 Change the way ATExecMergePartitions() handles the name collision
The name collision happens when the name of the new partition is the same as
the name of one of the merging partitions.  Currently, ATExecMergePartitions()
first gives the new partition a temporary name and then renames it when old
partitions are deleted.  That negatively influences the naming of related
objects like indexes and constrains, which could inherit a temporary name.

This commit changes the implementation in the following way.  A merging
partition gets renamed first, then the new partition is created with the
right name immediately.  This resolves the issue of the naming of related
objects.

Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/edfbd846-dcc1-42d1-ac26-715691b687d3%40postgrespro.ru
Author: Dmitry Koval, Alexander Korotkov
Reviewed-by: Robert Haas, Justin Pryzby, Pavel Borisov
2024-04-30 11:54:42 +03:00
..
Makefile Revert: Implement pg_wal_replay_wait() stored procedure 2024-04-11 17:28:15 +03:00
aggregatecmds.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
alter.c Remove ObjectClass type 2024-03-26 10:08:56 +01:00
amcmds.c Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
analyze.c revert: Generalize relation analyze in table AM interface 2024-04-16 13:14:20 +03:00
async.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
cluster.c Avoid repeating loads of frozen ID values. 2024-04-29 10:25:33 -07:00
collationcmds.c Address more review comments on commit 2d819a08a1. 2024-03-18 11:58:13 -07:00
comment.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
constraint.c Add missing index_insert_cleanup calls 2024-04-19 16:08:34 +02:00
conversioncmds.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
copy.c Disallow specifying ON_ERROR option without value. 2024-04-17 11:31:27 +09:00
copyfrom.c Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
copyfromparse.c Remove obsolete comment in CopyReadLineText(). 2024-04-06 11:16:27 -04:00
copyto.c Add RETURNING support to MERGE. 2024-03-17 13:58:59 +00:00
createas.c Revert: Let table AM insertion methods control index insertion 2024-04-11 16:01:30 +03:00
dbcommands.c createdb: compare strategy case-insensitive 2024-04-21 21:21:26 +02:00
define.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
discard.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
dropcmds.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
event_trigger.c Fix typos with function name in event_trigger.c 2024-04-17 14:56:31 +09:00
explain.c Fix incorrect format placeholders 2024-04-09 14:33:06 +02:00
extension.c Explicitly list dependent types as extension members in pg_depend. 2024-03-04 14:49:36 -05:00
foreigncmds.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
functioncmds.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
indexcmds.c Add temporal FOREIGN KEY contraints 2024-03-24 07:37:13 +01:00
lockcmds.c Reintroduce MAINTAIN privilege and pg_maintain predefined role. 2024-03-13 14:49:26 -05:00
matview.c Revert: Let table AM insertion methods control index insertion 2024-04-11 16:01:30 +03:00
meson.build Revert: Implement pg_wal_replay_wait() stored procedure 2024-04-11 17:28:15 +03:00
opclasscmds.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
operatorcmds.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
policy.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
portalcmds.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
prepare.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
proclang.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
publicationcmds.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
schemacmds.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
seclabel.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
sequence.c Replace BackendIds with 0-based ProcNumbers 2024-03-03 19:38:22 +02:00
statscmds.c Initialize variables to placate compiler. 2024-03-17 20:16:15 -05:00
subscriptioncmds.c Fix the handling of the failover option in subscription commands. 2024-04-23 12:22:30 +05:30
tablecmds.c Change the way ATExecMergePartitions() handles the name collision 2024-04-30 11:54:42 +03:00
tablespace.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
trigger.c Revert: Allow locking updated tuples in tuple_update() and tuple_delete() 2024-04-11 16:01:34 +03:00
tsearchcmds.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
typecmds.c Catalog domain not-null constraints 2024-03-20 10:05:37 +01:00
user.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
vacuum.c Avoid repeating loads of frozen ID values. 2024-04-29 10:25:33 -07:00
vacuumparallel.c Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
variable.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
view.c Separate equalRowTypes() from equalTupleDescs() 2024-03-17 05:58:04 +01:00