postgresql/src/backend/commands
Alvaro Herrera 640c20d626
Choose FK name correctly during partition attachment
During ALTER TABLE ATTACH PARTITION, if the name of a parent's foreign
key constraint is already used on the partition, the code tries to
choose another one before the FK attributes list has been populated,
so the resulting constraint name was "<relname>__fkey" instead of
"<relname>_<attrs>_fkey".  Repair, and add a test case.

Backpatch to 12.  In 11, the code to attach a partition was not smart
enough to cope with conflicting constraint names, so the problem doesn't
exist there.

Author: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Discussion: https://postgr.es/m/20220901184156.738ebee5@karst
2022-09-08 13:17:02 +02:00
..
aggregatecmds.c SQL-standard function body 2021-04-07 21:47:55 +02:00
alter.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
amcmds.c Fix some typos, grammar and style in docs and comments 2021-02-24 16:13:17 +09:00
analyze.c Invent qsort_interruptible(). 2022-07-12 16:30:36 -04:00
async.c Send NOTIFY signals during CommitTransaction. 2021-09-14 17:18:25 -04:00
cluster.c Make relation-enumerating operations be security-restricted operations. 2022-05-09 08:35:12 -07:00
collationcmds.c Disallow creating an ICU collation if the DB encoding won't support it. 2021-09-03 16:39:04 -04:00
comment.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
constraint.c Pass down "logically unchanged index" hint. 2021-01-13 08:11:00 -08:00
conversioncmds.c Add 'noError' argument to encoding conversion functions. 2021-04-01 11:45:22 +03:00
copy.c Rename Default Roles to Predefined Roles 2021-04-01 15:32:06 -04:00
copyfrom.c Fix typo in comment. 2022-03-30 19:00:02 +09:00
copyfromparse.c Fix typo in comment. 2022-08-26 16:55:02 +09:00
copyto.c Fix incorrect memory context switch in COPY TO execution 2022-01-29 10:23:17 +09:00
createas.c In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
dbcommands.c Fix replay of create database records on standby 2022-07-28 08:26:05 +02:00
define.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
discard.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
dropcmds.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
event_trigger.c Improve handling of dropped objects in pg_event_trigger_ddl_commands() 2021-06-14 14:57:22 +09:00
explain.c Add compute_query_id = regress 2022-02-22 10:23:49 +09:00
extension.c Lock the extension during ALTER EXTENSION ADD/DROP. 2021-07-11 12:54:24 -04:00
foreigncmds.c In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
functioncmds.c Fix breakage in AlterFunction(). 2022-04-19 23:03:59 -04:00
indexcmds.c Fix subtly-incorrect matching of parent and child partitioned indexes. 2022-08-18 12:11:47 -04:00
lockcmds.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
Makefile Split copy.c into four files. 2020-11-23 10:50:50 +02:00
matview.c In REFRESH MATERIALIZED VIEW, set user ID before running user code. 2022-05-09 08:35:12 -07:00
opclasscmds.c Fix DDL deparse of CREATE OPERATOR CLASS 2022-05-20 18:52:55 +02:00
operatorcmds.c Prevent ALTER TYPE/DOMAIN/OPERATOR from changing extension membership. 2021-08-17 14:29:22 -04:00
policy.c Remove unnecessary failure cases in RemoveRoleFromObjectPolicy(). 2021-06-25 13:59:38 -04:00
portalcmds.c Fix some anomalies with NO SCROLL cursors. 2021-09-10 13:18:32 -04:00
prepare.c Centralize the logic for protective copying of utility statements. 2021-06-18 11:22:58 -04:00
proclang.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
publicationcmds.c Invalidate all partitions for a partitioned table in publication. 2021-09-22 08:13:37 +05:30
schemacmds.c In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
seclabel.c Check criticalSharedRelcachesBuilt in GetSharedSecurityLabel(). 2021-10-14 12:24:22 -07:00
sequence.c In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
statscmds.c In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
subscriptioncmds.c Fix Alter Subscription's Add/Drop Publication behavior. 2021-08-24 08:38:11 +05:30
tablecmds.c Choose FK name correctly during partition attachment 2022-09-08 13:17:02 +02:00
tablespace.c Fix replay of create database records on standby 2022-07-28 08:26:05 +02:00
trigger.c Fix ENABLE/DISABLE TRIGGER to handle recursion correctly 2022-08-05 09:47:11 +02:00
tsearchcmds.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
typecmds.c Fix use-after-free with multirange types in CREATE TYPE 2021-10-13 16:38:15 +09:00
user.c Revert error handling improvements for cryptohashes 2022-01-14 11:25:39 +09:00
vacuum.c Support disabling index bypassing by VACUUM. 2021-06-18 20:04:07 -07:00
variable.c Fix some inappropriately-disallowed uses of ALTER ROLE/DATABASE SET. 2021-04-13 15:10:18 -04:00
view.c In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00