pgsql: Remove the streaming files for incomplete xacts after restart.

2023-01-06 Thread Amit Kapila
Remove the streaming files for incomplete xacts after restart. After restart, we try to stream the changes for large transactions that were not sent before server crash and restart. However, we forget to send the abort message for such transactions. This leads to spurious streaming files on the

pgsql: Remove the streaming files for incomplete xacts after restart.

2023-01-06 Thread Amit Kapila
Remove the streaming files for incomplete xacts after restart. After restart, we try to stream the changes for large transactions that were not sent before server crash and restart. However, we forget to send the abort message for such transactions. This leads to spurious streaming files on the

pgsql: Remove the streaming files for incomplete xacts after restart.

2023-01-06 Thread Amit Kapila
Remove the streaming files for incomplete xacts after restart. After restart, we try to stream the changes for large transactions that were not sent before server crash and restart. However, we forget to send the abort message for such transactions. This leads to spurious streaming files on the

pgsql: Add additional regression tests for select_active_windows

2023-01-06 Thread David Rowley
Add additional regression tests for select_active_windows During the development of 728202b63, which was aimed at reducing the number of sorts required to evaluate multiple window functions with different WindowClause definitions, the code written sorted the WindowClauses in reverse

pgsql: Wake up a subscription's replication worker processes after DDL.

2023-01-06 Thread Tom Lane
Wake up a subscription's replication worker processes after DDL. Waken related worker processes immediately at commit of a transaction that has performed ALTER SUBSCRIPTION (including the RENAME and OWNER variants). This reduces the response time for such operations. In the real world that might

pgsql: Check for two_phase change at end of process_syncing_tables_for_

2023-01-06 Thread Tom Lane
Check for two_phase change at end of process_syncing_tables_for_apply. Previously this function checked to see if we were ready to switch to two_phase mode at its start, but that's silly: we should check at the end, after we've done the work that might make us ready. This simple change removes

pgsql: Allow hyphens in ltree labels

2023-01-06 Thread Andrew Dunstan
Allow hyphens in ltree labels Also increase the allowed length of labels to 1000 characters Garen Torikian Discussion: https://postgr.es/m/cagxsc+-mng9gc0rp-er0sv+zkzszp2we9-lx6xcowslvz22...@mail.gmail.com Branch -- master Details ---

pgsql: Add options to control whether VACUUM runs vac_update_datfrozenx

2023-01-06 Thread Tom Lane
Add options to control whether VACUUM runs vac_update_datfrozenxid. VACUUM normally ends by running vac_update_datfrozenxid(), which requires a scan of pg_class. Therefore, if one attempts to vacuum a database one table at a time --- as vacuumdb has done since v12 --- we will spend O(N^2) time

pgsql: Invalidate pgoutput's replication-decisions cache upon schema re

2023-01-06 Thread Tom Lane
Invalidate pgoutput's replication-decisions cache upon schema rename. A schema rename should cause reporting the new qualified names of tables to logical replication subscribers, but that wasn't happening. Flush the RelationSyncCache to make it happen. (If you ask me, the new test case shows

pgsql: Fix stale comment about sample_frac adjustment

2023-01-06 Thread Tomas Vondra
Fix stale comment about sample_frac adjustment A comment was left behind referencing sample rate adjustment removed from 8ad51b5f44. So clean that up. While at it also remove the sample rate clamping which should not be necessary without the clamping, and just check that with an assert.

pgsql: Fix typo

2023-01-06 Thread Peter Eisentraut
Fix typo This doesn't affect the correctness of the code, but it was clearly inconsistent before this change. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4037c5e2fe9e2c7b083606435d29cdb25092f70f Modified Files -- src/backend/parser/parse_node.c | 2

pgsql: Fix tab completion of ALTER FUNCTION/PROCEDURE/ROUTINE ... SET S

2023-01-06 Thread Dean Rasheed
Fix tab completion of ALTER FUNCTION/PROCEDURE/ROUTINE ... SET SCHEMA. The ALTER DATABASE|FUNCTION|PROCEDURE|ROLE|ROUTINE|USER ... SET case in psql tab completion failed to exclude = "SCHEMA", which caused ALTER FUNCTION|PROCEDURE|ROUTINE ... SET SCHEMA to complete with "FROM CURRENT" and "TO",

pgsql: Fix tab completion of ALTER FUNCTION/PROCEDURE/ROUTINE ... SET S

2023-01-06 Thread Dean Rasheed
Fix tab completion of ALTER FUNCTION/PROCEDURE/ROUTINE ... SET SCHEMA. The ALTER DATABASE|FUNCTION|PROCEDURE|ROLE|ROUTINE|USER ... SET case in psql tab completion failed to exclude = "SCHEMA", which caused ALTER FUNCTION|PROCEDURE|ROUTINE ... SET SCHEMA to complete with "FROM CURRENT" and "TO",

pgsql: Fix tab completion of ALTER FUNCTION/PROCEDURE/ROUTINE ... SET S

2023-01-06 Thread Dean Rasheed
Fix tab completion of ALTER FUNCTION/PROCEDURE/ROUTINE ... SET SCHEMA. The ALTER DATABASE|FUNCTION|PROCEDURE|ROLE|ROUTINE|USER ... SET case in psql tab completion failed to exclude = "SCHEMA", which caused ALTER FUNCTION|PROCEDURE|ROUTINE ... SET SCHEMA to complete with "FROM CURRENT" and "TO",

pgsql: Fix tab completion of ALTER FUNCTION/PROCEDURE/ROUTINE ... SET S

2023-01-06 Thread Dean Rasheed
Fix tab completion of ALTER FUNCTION/PROCEDURE/ROUTINE ... SET SCHEMA. The ALTER DATABASE|FUNCTION|PROCEDURE|ROLE|ROUTINE|USER ... SET case in psql tab completion failed to exclude = "SCHEMA", which caused ALTER FUNCTION|PROCEDURE|ROUTINE ... SET SCHEMA to complete with "FROM CURRENT" and "TO",

pgsql: Fix tab completion of ALTER FUNCTION/PROCEDURE/ROUTINE ... SET S

2023-01-06 Thread Dean Rasheed
Fix tab completion of ALTER FUNCTION/PROCEDURE/ROUTINE ... SET SCHEMA. The ALTER DATABASE|FUNCTION|PROCEDURE|ROLE|ROUTINE|USER ... SET case in psql tab completion failed to exclude = "SCHEMA", which caused ALTER FUNCTION|PROCEDURE|ROUTINE ... SET SCHEMA to complete with "FROM CURRENT" and "TO",

pgsql: Fix tab completion of ALTER FUNCTION/PROCEDURE/ROUTINE ... SET S

2023-01-06 Thread Dean Rasheed
Fix tab completion of ALTER FUNCTION/PROCEDURE/ROUTINE ... SET SCHEMA. The ALTER DATABASE|FUNCTION|PROCEDURE|ROLE|ROUTINE|USER ... SET case in psql tab completion failed to exclude = "SCHEMA", which caused ALTER FUNCTION|PROCEDURE|ROUTINE ... SET SCHEMA to complete with "FROM CURRENT" and "TO",

pgsql: Improve tab completion for ALTER FUNCTION/PROCEDURE/ROUTINE.

2023-01-06 Thread Dean Rasheed
Improve tab completion for ALTER FUNCTION/PROCEDURE/ROUTINE. This adds psql tab completion for each of the actions supported by ALTER FUNCTION/PROCEDURE/ROUTINE. Vignesh C, reviewed by Dong Wook Lee, Michael Paquier, Melih Mutlu and me. Discussion: