pgsql: Fix performance regression in tuplesort specializations

2022-04-21 Thread David Rowley
Fix performance regression in tuplesort specializations 697492434 added 3 new qsort specialization functions aimed to improve the performance of sorting many of the common pass-by-value data types when they're the leading or only sort key. Unfortunately, that has caused a performance regression w

pgsql: Remove inadequate assertion check in CTE inlining.

2022-04-21 Thread Tom Lane
Remove inadequate assertion check in CTE inlining. inline_cte() expected to find exactly as many references to the target CTE as its cterefcount indicates. While that should be accurate for the tree as emitted by the parser, there are some optimizations that occur upstream of here that could fals

pgsql: Remove inadequate assertion check in CTE inlining.

2022-04-21 Thread Tom Lane
Remove inadequate assertion check in CTE inlining. inline_cte() expected to find exactly as many references to the target CTE as its cterefcount indicates. While that should be accurate for the tree as emitted by the parser, there are some optimizations that occur upstream of here that could fals

pgsql: Remove inadequate assertion check in CTE inlining.

2022-04-21 Thread Tom Lane
Remove inadequate assertion check in CTE inlining. inline_cte() expected to find exactly as many references to the target CTE as its cterefcount indicates. While that should be accurate for the tree as emitted by the parser, there are some optimizations that occur upstream of here that could fals

pgsql: Remove inadequate assertion check in CTE inlining.

2022-04-21 Thread Tom Lane
Remove inadequate assertion check in CTE inlining. inline_cte() expected to find exactly as many references to the target CTE as its cterefcount indicates. While that should be accurate for the tree as emitted by the parser, there are some optimizations that occur upstream of here that could fals

pgsql: Fix missed cases in libpq's error handling.

2022-04-21 Thread Tom Lane
Fix missed cases in libpq's error handling. Commit 618c16707 invented an "error_result" flag in PGconn, which intends to represent the state that we have an error condition and need to build a PGRES_FATAL_ERROR PGresult from the message text in conn->errorMessage, but have not yet done so. (Postp

pgsql: Rethink method for assigning OIDs to the template0 and postgres

2022-04-21 Thread Tom Lane
Rethink method for assigning OIDs to the template0 and postgres DBs. Commit aa0105141 assigned fixed OIDs to template0 and postgres in a very ad-hoc way. Notably, instead of teaching Catalog.pm about these OIDs, the unused_oids script was just hacked to not show them as unused. That's problemati

pgsql: Standardize references to Zstandard as

2022-04-21 Thread Alvaro Herrera
Standardize references to Zstandard as Some places used ZSTD, which isn't widely used anywhere. Use ZSTD only to refer to the environment variable; use zstd (all lowercase) to refer to the utility. Per complaint from Justin Pryzby. Discussion: https://postgr.es/m/20220414003301.gt26...@telsaso

pgsql: CREATE PUBLICATION ref: Minor tweaks to row filters

2022-04-21 Thread Alvaro Herrera
CREATE PUBLICATION ref: Minor tweaks to row filters Prompted by a complaint from Justin Pryzby. Reviewed-by: Amit Kapila Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/bb85eec6fe9178aa849b43414f

pgsql: Use DECLARE_TOAST_WITH_MACRO() to simplify toast-table declarati

2022-04-21 Thread Tom Lane
Use DECLARE_TOAST_WITH_MACRO() to simplify toast-table declarations. This is needed so that renumber_oids.pl can handle renumbering shared catalog declarations, which need to provide C macros for the OIDs of the shared toast table and index. The previous method of writing a C macro separately was

pgsql: Support new perl module namespace in stable branches

2022-04-21 Thread Andrew Dunstan
Support new perl module namespace in stable branches Commit b3b4d8e68a moved our perl test modules to a better namespace structure, but this has made life hard for people wishing to backpatch improvements in the TAP tests. Here we alleviate much of that difficulty by implementing the new module na

pgsql: Support new perl module namespace in stable branches

2022-04-21 Thread Andrew Dunstan
Support new perl module namespace in stable branches Commit b3b4d8e68a moved our perl test modules to a better namespace structure, but this has made life hard for people wishing to backpatch improvements in the TAP tests. Here we alleviate much of that difficulty by implementing the new module na

pgsql: Support new perl module namespace in stable branches

2022-04-21 Thread Andrew Dunstan
Support new perl module namespace in stable branches Commit b3b4d8e68a moved our perl test modules to a better namespace structure, but this has made life hard for people wishing to backpatch improvements in the TAP tests. Here we alleviate much of that difficulty by implementing the new module na

pgsql: Support new perl module namespace in stable branches

2022-04-21 Thread Andrew Dunstan
Support new perl module namespace in stable branches Commit b3b4d8e68a moved our perl test modules to a better namespace structure, but this has made life hard for people wishing to backpatch improvements in the TAP tests. Here we alleviate much of that difficulty by implementing the new module na

pgsql: Support new perl module namespace in stable branches

2022-04-21 Thread Andrew Dunstan
Support new perl module namespace in stable branches Commit b3b4d8e68a moved our perl test modules to a better namespace structure, but this has made life hard for people wishing to backpatch improvements in the TAP tests. Here we alleviate much of that difficulty by implementing the new module na