pgsql: Fix corruption of pgstats shared hashtable due to OOM failures

2025-09-07 Thread Michael Paquier
Fix corruption of pgstats shared hashtable due to OOM failures A new pgstats entry is created as a two-step process: - The entry is looked at in the shared hashtable of pgstats, and is inserted if not found. - When not found and inserted, its fields are then initialized. This part include a DSA c

pgsql: Fix corruption of pgstats shared hashtable due to OOM failures

2025-09-07 Thread Michael Paquier
Fix corruption of pgstats shared hashtable due to OOM failures A new pgstats entry is created as a two-step process: - The entry is looked at in the shared hashtable of pgstats, and is inserted if not found. - When not found and inserted, its fields are then initialized. This part include a DSA c

pgsql: Fix corruption of pgstats shared hashtable due to OOM failures

2025-09-07 Thread Michael Paquier
Fix corruption of pgstats shared hashtable due to OOM failures A new pgstats entry is created as a two-step process: - The entry is looked at in the shared hashtable of pgstats, and is inserted if not found. - When not found and inserted, its fields are then initialized. This part include a DSA c

pgsql: Post-commit review fixes for 228c370868.

2025-09-07 Thread Amit Kapila
Post-commit review fixes for 228c370868. This commit fixes three issues: 1) When a disabled subscription is created with retain_dead_tuples set to true, the launcher is not woken up immediately, which may lead to delays in creating the conflict detection slot. Creating the conflict detection slo

pgsql: Update parser README to include parse_jsontable.c

2025-09-07 Thread Michael Paquier
Update parser README to include parse_jsontable.c The README was missing parse_jsontable.c which handles JSON_TABLE. Oversight in de3600452b61. Author: Karthik S Discussion: https://postgr.es/m/CAK4gQD9gdcj+vq_FZGp=Rv-W+41v8_C7cmCUmDeu=cfrodf...@mail.gmail.com Backpatch-through: 17 Branch

pgsql: Update parser README to include parse_jsontable.c

2025-09-07 Thread Michael Paquier
Update parser README to include parse_jsontable.c The README was missing parse_jsontable.c which handles JSON_TABLE. Oversight in de3600452b61. Author: Karthik S Discussion: https://postgr.es/m/CAK4gQD9gdcj+vq_FZGp=Rv-W+41v8_C7cmCUmDeu=cfrodf...@mail.gmail.com Backpatch-through: 17 Branch

pgsql: Update parser README to include parse_jsontable.c

2025-09-07 Thread Michael Paquier
Update parser README to include parse_jsontable.c The README was missing parse_jsontable.c which handles JSON_TABLE. Oversight in de3600452b61. Author: Karthik S Discussion: https://postgr.es/m/CAK4gQD9gdcj+vq_FZGp=Rv-W+41v8_C7cmCUmDeu=cfrodf...@mail.gmail.com Backpatch-through: 17 Branch

pgsql: Move dynamically-allocated LWLock tranche names to shared memory

2025-09-07 Thread Nathan Bossart
Move dynamically-allocated LWLock tranche names to shared memory. There are two ways for shared libraries to allocate their own LWLock tranches. One way is to call RequestNamedLWLockTranche() in a shmem_request_hook, which requires the library to be loaded via shared_preload_libraries. The other

pgsql: Fix replica identity check for INSERT ON CONFLICT DO UPDATE.

2025-09-07 Thread Dean Rasheed
Fix replica identity check for INSERT ON CONFLICT DO UPDATE. If an INSERT has an ON CONFLICT DO UPDATE clause, the executor must check that the target relation supports UPDATE as well as INSERT. In particular, it must check that the target relation has a REPLICA IDENTITY if it publishes updates. F

pgsql: Fix replica identity check for INSERT ON CONFLICT DO UPDATE.

2025-09-07 Thread Dean Rasheed
Fix replica identity check for INSERT ON CONFLICT DO UPDATE. If an INSERT has an ON CONFLICT DO UPDATE clause, the executor must check that the target relation supports UPDATE as well as INSERT. In particular, it must check that the target relation has a REPLICA IDENTITY if it publishes updates. F

pgsql: Fix replica identity check for INSERT ON CONFLICT DO UPDATE.

2025-09-07 Thread Dean Rasheed
Fix replica identity check for INSERT ON CONFLICT DO UPDATE. If an INSERT has an ON CONFLICT DO UPDATE clause, the executor must check that the target relation supports UPDATE as well as INSERT. In particular, it must check that the target relation has a REPLICA IDENTITY if it publishes updates. F

pgsql: Fix replica identity check for MERGE.

2025-09-07 Thread Dean Rasheed
Fix replica identity check for MERGE. When executing a MERGE, check that the target relation supports all actions mentioned in the MERGE command. Specifically, check that it has a REPLICA IDENTITY if it publishes updates or deletes and the MERGE command contains update or delete actions. Failing t