postgresql/src/backend
Tom Lane 641f3dffcd Restore the previous semantics of get_constraint_index().
Commit 8b069ef5d changed this function to look at pg_constraint.conindid
rather than searching pg_depend.  That was a good performance improvement,
but it failed to preserve the exact semantics.  The old code would only
return an index that was "owned by" (internally dependent on) the
specified constraint, whereas the new code will also return indexes that
are just referenced by foreign key constraints.  This confuses ALTER
TABLE, which was implicitly expecting the previous semantics, into
failing with errors like
    ERROR:  relation 146621 has multiple clustered indexes
or
    ERROR:  "pk_attbl" is not an index for table "atref"

We can fix this without reverting the performance improvement by adding
a contype check in get_constraint_index().  Another way could be to
make ALTER TABLE check it, but I'm worried that extension code could
also have subtle dependencies on the old semantics.

Tom Lane and Japin Li, per bug #17409 from Holly Roberts.
Back-patch to v14 where the error crept in.

Discussion: https://postgr.es/m/17409-52871dda8b5741cb@postgresql.org
2022-03-11 13:47:29 -05:00
..
access Add support for zstd with compression of full-page writes in WAL 2022-03-11 12:18:53 +09:00
bootstrap pg_upgrade: Preserve relfilenodes and tablespace OIDs. 2022-01-17 13:40:27 -05:00
catalog Parse/analyze function renaming 2022-03-04 14:50:22 +01:00
commands DefineCollation() code cleanup 2022-03-11 08:32:52 +01:00
executor Improve comment in execReplication.c 2022-03-08 14:29:03 +09:00
foreign Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
jit Track LLVM 15 changes. 2022-02-14 15:51:43 +13:00
lib dshash: Add sequential scan support. 2022-03-10 12:57:05 -08:00
libpq Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
main windows: Improve crash / assert / exception handling. 2022-02-02 18:33:25 -08:00
nodes Allow specifying row filters for logical replication of tables. 2022-02-22 08:11:50 +05:30
optimizer Parse/analyze function renaming 2022-03-04 14:50:22 +01:00
parser Add parse_analyze_withcb() 2022-03-09 11:08:16 +01:00
partitioning Fix misuse of "const" qualifier. 2022-02-13 19:20:56 -05:00
po Translation updates 2021-06-21 12:33:50 +02:00
port Ensure that the argument of shmdt(2) is declared "void *". 2022-02-15 17:17:28 -05:00
postmaster Reconsider pg_stat_subscription_workers view. 2022-03-01 06:17:52 +05:30
regex Call pg_newlocale_from_collation() also with default collation 2022-01-20 09:50:18 +01:00
replication Fix LZ4 tests for remaining buffer space. 2022-03-08 10:05:55 -05:00
rewrite Update copyright for 2022 2022-01-07 19:04:57 -05:00
snowball Update copyright for 2022 2022-01-07 19:04:57 -05:00
statistics Fix various typos, grammar and code style in comments and docs 2022-01-25 09:40:04 +09:00
storage Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
tcop Add parse_analyze_withcb() 2022-03-09 11:08:16 +01:00
tsearch Update copyright for 2022 2022-01-07 19:04:57 -05:00
utils Restore the previous semantics of get_constraint_index(). 2022-03-11 13:47:29 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Server-side gzip compression. 2022-01-24 15:13:18 -05:00
nls.mk Report progress of startup operations that take a long time. 2021-10-25 11:51:57 -04:00