postgresql/src
Tom Lane 3839e29c58 Flush table's relcache during ALTER TABLE ADD PRIMARY KEY USING INDEX.
Previously, unless we had to add a NOT NULL constraint to the column,
this command resulted in updating only the index's relcache entry.
That's problematic when replication behavior is being driven off the
existence of a primary key: other sessions (and ours too for that
matter) failed to recalculate their opinion of whether the table can
be replicated.  Add a relcache invalidation to fix it.

This has been broken since pg_class.relhaspkey was removed in v11.
Before that, updating the table's relhaspkey value sufficed to cause
a cache flush.  Hence, backpatch to v11.

Report and patch by Hou Zhijie

Discussion: https://postgr.es/m/OS0PR01MB5716EBE01F112C62F8F9B786947B9@OS0PR01MB5716.jpnprd01.prod.outlook.com
2022-01-22 13:32:40 -05:00
..
backend Flush table's relcache during ALTER TABLE ADD PRIMARY KEY USING INDEX. 2022-01-22 13:32:40 -05:00
bin Fix psql \d's query for identifying parent triggers. 2022-01-17 21:18:49 -05:00
common Revert error handling improvements for cryptohashes 2022-01-14 11:25:39 +09:00
fe_utils Avoid calling gettext() in signal handlers. 2022-01-17 13:30:04 -05:00
include Revert error handling improvements for cryptohashes 2022-01-14 11:25:39 +09:00
interfaces Fix race condition in gettext() initialization in libpq and ecpglib. 2022-01-21 15:36:28 -05:00
makefiles Add NO_INSTALL option to pgxs 2021-05-27 13:58:29 +02:00
pl Remove unneeded Python includes 2021-11-25 14:30:12 +01:00
port Fix compatibility thinko for fstat() on standard streams in win32stat.c 2021-11-30 09:55:56 +09:00
template Further tweaking of PG_SYSROOT heuristics for macOS. 2021-01-20 12:07:23 -05:00
test Flush table's relcache during ALTER TABLE ADD PRIMARY KEY USING INDEX. 2022-01-22 13:32:40 -05:00
timezone Update time zone data files to tzdata release 2021e. 2021-10-29 11:38:32 -04:00
tools Allow clean.bat to be run from anywhere 2022-01-20 10:20:40 -05:00
tutorial doc: Prefer explicit JOIN syntax over old implicit syntax in tutorial 2021-04-08 10:51:26 +02: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 Add module build directory to the PATH for TAP tests 2021-10-22 09:50:16 -04:00
Makefile.shlib AIX: Fix missing libpq symbols by respecting SHLIB_EXPORTS. 2021-09-06 11:28:02 -07:00
nls-global.mk Add errhint_plural() function and make use of it 2021-03-31 09:16:25 +02:00