pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Flush table's relcache during ALTER TABLE ADD PRIMARY KEY USING 5+ messages / 1 participants [nested] [flat]
* pgsql: Flush table's relcache during ALTER TABLE ADD PRIMARY KEY USING @ 2022-01-22 18:32 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2022-01-22 18:32 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/3839e29c58b44639bb6800f3415af87f4d1fb655 Modified Files -------------- src/backend/catalog/index.c | 11 +++++++++++ src/test/regress/expected/publication.out | 14 ++++++++++++++ src/test/regress/sql/publication.sql | 13 +++++++++++++ 3 files changed, 38 insertions(+) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Flush table's relcache during ALTER TABLE ADD PRIMARY KEY USING @ 2022-01-22 18:32 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2022-01-22 18:32 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/d8fbbb925bdb8ca1c8eb8572192f4ee199f4d276 Modified Files -------------- src/backend/catalog/index.c | 11 +++++++++++ src/test/regress/expected/publication.out | 14 ++++++++++++++ src/test/regress/sql/publication.sql | 13 +++++++++++++ 3 files changed, 38 insertions(+) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Flush table's relcache during ALTER TABLE ADD PRIMARY KEY USING @ 2022-01-22 18:32 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2022-01-22 18:32 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/31b7b4d26e10086d4a79d49a28fd161da52da49a Modified Files -------------- src/backend/catalog/index.c | 11 +++++++++++ src/test/regress/expected/publication.out | 14 ++++++++++++++ src/test/regress/sql/publication.sql | 13 +++++++++++++ 3 files changed, 38 insertions(+) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Flush table's relcache during ALTER TABLE ADD PRIMARY KEY USING @ 2022-01-22 18:33 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2022-01-22 18:33 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/26c841ed1b2d4ca33bc530a12956eb690253fdb2 Modified Files -------------- src/backend/catalog/index.c | 11 +++++++++++ src/test/regress/expected/publication.out | 14 ++++++++++++++ src/test/regress/sql/publication.sql | 13 +++++++++++++ 3 files changed, 38 insertions(+) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Flush table's relcache during ALTER TABLE ADD PRIMARY KEY USING @ 2022-01-22 18:33 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2022-01-22 18:33 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e2d53c8767da9f98c7c4c8d0b129171848472c93 Modified Files -------------- src/backend/catalog/index.c | 11 +++++++++++ src/test/regress/expected/publication.out | 14 ++++++++++++++ src/test/regress/sql/publication.sql | 13 +++++++++++++ 3 files changed, 38 insertions(+) ^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2022-01-22 18:33 UTC | newest] Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2022-01-22 18:32 pgsql: Flush table's relcache during ALTER TABLE ADD PRIMARY KEY USING Tom Lane <tgl@sss.pgh.pa.us> 2022-01-22 18:32 pgsql: Flush table's relcache during ALTER TABLE ADD PRIMARY KEY USING Tom Lane <tgl@sss.pgh.pa.us> 2022-01-22 18:32 pgsql: Flush table's relcache during ALTER TABLE ADD PRIMARY KEY USING Tom Lane <tgl@sss.pgh.pa.us> 2022-01-22 18:33 pgsql: Flush table's relcache during ALTER TABLE ADD PRIMARY KEY USING Tom Lane <tgl@sss.pgh.pa.us> 2022-01-22 18:33 pgsql: Flush table's relcache during ALTER TABLE ADD PRIMARY KEY USING Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox