pgsql: doc: Add description of some missing monitoring functions

2023-03-22 Thread Michael Paquier
that all the functions whose descriptions were removed are used in system views. Unfortunately, some of them were are not used in any system views, so they lacked documentation. This gap exists in the docs for a long time, so backpatch all the way down. Reported-by: Michael Paquier Author

pgsql: doc: Add description of some missing monitoring functions

2023-03-22 Thread Michael Paquier
that all the functions whose descriptions were removed are used in system views. Unfortunately, some of them were are not used in any system views, so they lacked documentation. This gap exists in the docs for a long time, so backpatch all the way down. Reported-by: Michael Paquier Author

pgsql: doc: Add description of some missing monitoring functions

2023-03-22 Thread Michael Paquier
that all the functions whose descriptions were removed are used in system views. Unfortunately, some of them were are not used in any system views, so they lacked documentation. This gap exists in the docs for a long time, so backpatch all the way down. Reported-by: Michael Paquier Author

pgsql: doc: Add description of some missing monitoring functions

2023-03-22 Thread Michael Paquier
that all the functions whose descriptions were removed are used in system views. Unfortunately, some of them were are not used in any system views, so they lacked documentation. This gap exists in the docs for a long time, so backpatch all the way down. Reported-by: Michael Paquier Author

pgsql: doc: Add description of some missing monitoring functions

2023-03-22 Thread Michael Paquier
that all the functions whose descriptions were removed are used in system views. Unfortunately, some of them were are not used in any system views, so they lacked documentation. This gap exists in the docs for a long time, so backpatch all the way down. Reported-by: Michael Paquier Author

pgsql: doc: Add description of some missing monitoring functions

2023-03-22 Thread Michael Paquier
that all the functions whose descriptions were removed are used in system views. Unfortunately, some of them were are not used in any system views, so they lacked documentation. This gap exists in the docs for a long time, so backpatch all the way down. Reported-by: Michael Paquier Author

pgsql: Fix a couple of typos

2023-03-21 Thread Michael Paquier
Fix a couple of typos PL/pgSQL was misspelled in a few places, so fix these. Author: Zhang Mingli Reviewed-by: Richard Guo Discussion: https://postgr.es/m/1bd41572-9cd9-465e-9f59-ee45385e51b4@Spark Branch -- master Details ---

pgsql: Fix make maintainer-clean with queryjumblefuncs.*.c files in src

2023-03-21 Thread Michael Paquier
Fix make maintainer-clean with queryjumblefuncs.*.c files in src/backend/nodes/ The files generated by gen_node_support.pl for query jumbling (queryjumblefuncs.funcs.c and queryjumblefuncs.switch.c) were not being removed on make maintainer-clean (they need to remain around after a simple

pgsql: Add files related to query jumbling in src/include/nodes/ for me

2023-03-18 Thread Michael Paquier
Add files related to query jumbling in src/include/nodes/ for meson This caused ninja clean to not remove the two files generated by gen_node_support.pl for the query jumbling, for example: queryjumblefuncs.funcs.c and queryjumblefuncs.switch.c. Reported-by: Pavel Stehule Discussion:

pgsql: libpq: Remove code for SCM credential authentication

2023-03-16 Thread Michael Paquier
are removed from the protocol documentation. This removes some meson and configure checks. Author: Michael Paquier Reviewed-by: Tom Lane Discussion: https://postgr.es/m/zblh8a4otfqgd...@paquier.xyz Branch -- master Details --- https://git.postgresql.org/pg/commitdiff

pgsql: Remove PgStat_BackendFunctionEntry

2023-03-15 Thread Michael Paquier
Remove PgStat_BackendFunctionEntry This structure included only PgStat_FunctionCounts, and removing it facilitates some upcoming refactoring for pgstatfuncs.c to use more macros rather that mostly-duplicated functions. Author: Bertrand Drouvot Reviewed-by: Nathan Bossart Discussion:

pgsql: Tweak regression test of pg_walinspect to be less collation-sens

2023-03-15 Thread Michael Paquier
Tweak regression test of pg_walinspect to be less collation-sensitive \dx was used on pg_walinspect to list its objects in 1.0 but the names of the objects in this version do not have an order that is always guaranteed depending on the collation used. Rather than append a COLLATE clause in the

pgsql: Add .gitignore to ldap_password_func

2023-03-15 Thread Michael Paquier
Add .gitignore to ldap_password_func This bit has been forgotten in 419a8dd. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c9a272daaa43a29cbfca44f4823cab65cb9725bd Modified Files -- src/test/modules/ldap_password_func/.gitignore | 4 1 file

pgsql: Improve handling of psql \watch's interval argument

2023-03-15 Thread Michael Paquier
Horiguchi, Nathan Bossart, Michael Paquier Discussion: https://postgr.es/m/CAAhFRxiZ2-n_L1ErMm9AZjgmUK=qs6vhb+0samn8sqqbhf7...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/6f9ee74d45aa7c1836b6c12b6e2a958327c16ab5 Modified Files -- src/bin

pgsql: Improve WIN32 port of fstat() to detect more file types

2023-03-14 Thread Michael Paquier
Improve WIN32 port of fstat() to detect more file types The current implementation of _pgfstat64() is ineffective in detecting a terminal handle or an anonymous named pipe. This commit improves our port of fstat() to detect more efficiently such cases by relying on GetFileType(), and returning

pgsql: Improve WIN32 port of fstat() to detect more file types

2023-03-14 Thread Michael Paquier
Improve WIN32 port of fstat() to detect more file types The current implementation of _pgfstat64() is ineffective in detecting a terminal handle or an anonymous named pipe. This commit improves our port of fstat() to detect more efficiently such cases by relying on GetFileType(), and returning

pgsql: Improve WIN32 port of fstat() to detect more file types

2023-03-14 Thread Michael Paquier
Improve WIN32 port of fstat() to detect more file types The current implementation of _pgfstat64() is ineffective in detecting a terminal handle or an anonymous named pipe. This commit improves our port of fstat() to detect more efficiently such cases by relying on GetFileType(), and returning

pgsql: Rework design of functions in pg_walinspect

2023-03-14 Thread Michael Paquier
Rework design of functions in pg_walinspect This commit reworks a bit the set-returning functions of pg_walinspect, making them more flexible regarding their end LSN: - pg_get_wal_records_info() - pg_get_wal_stats() - pg_get_wal_block_info() The end LSNs given to these functions is now handled

pgsql: libpq: Add support for require_auth to control authorized auth m

2023-03-13 Thread Michael Paquier
r compatibility reasons). A new TAP script has been added for SSPI, as there was no script dedicated to it yet. It relies on SSPI being the default authentication method on Windows, as set by pg_regress. Author: Jacob Champion Reviewed-by: Peter Eisentraut, David G. Johnston, Michael Paqu

pgsql: Fix inconsistent error handling for GSS encryption in PQconnectP

2023-03-13 Thread Michael Paquier
akes the error handling of GSS encryption on par with TLS portion, fixing the case of gssencmode=require. Reported-by: Jacob Champion Author: Michael Paquier Reviewed-by: Jacob Champion, Stephen Frost Discussion: https://postgr.es/m/23787477-5fe1-a161-6d2a-e459f74c4...@timescale.com Backpatch-thr

pgsql: Fix inconsistent error handling for GSS encryption in PQconnectP

2023-03-13 Thread Michael Paquier
akes the error handling of GSS encryption on par with TLS portion, fixing the case of gssencmode=require. Reported-by: Jacob Champion Author: Michael Paquier Reviewed-by: Jacob Champion, Stephen Frost Discussion: https://postgr.es/m/23787477-5fe1-a161-6d2a-e459f74c4...@timescale.com

pgsql: Fix inconsistent error handling for GSS encryption in PQconnectP

2023-03-13 Thread Michael Paquier
akes the error handling of GSS encryption on par with TLS portion, fixing the case of gssencmode=require. Reported-by: Jacob Champion Author: Michael Paquier Reviewed-by: Jacob Champion, Stephen Frost Discussion: https://postgr.es/m/23787477-5fe1-a161-6d2a-e459f74c4...@timescale.com

pgsql: Fix inconsistent error handling for GSS encryption in PQconnectP

2023-03-13 Thread Michael Paquier
akes the error handling of GSS encryption on par with TLS portion, fixing the case of gssencmode=require. Reported-by: Jacob Champion Author: Michael Paquier Reviewed-by: Jacob Champion, Stephen Frost Discussion: https://postgr.es/m/23787477-5fe1-a161-6d2a-e459f74c4...@timescale.com

pgsql: Fix inconsistent error handling for GSS encryption in PQconnectP

2023-03-13 Thread Michael Paquier
akes the error handling of GSS encryption on par with TLS portion, fixing the case of gssencmode=require. Reported-by: Jacob Champion Author: Michael Paquier Reviewed-by: Jacob Champion, Stephen Frost Discussion: https://postgr.es/m/23787477-5fe1-a161-6d2a-e459f74c4...@timescale.com

pgsql: Refactor and improve tests of pg_walinspect

2023-03-12 Thread Michael Paquier
with the upcoming work aimed to lift the bound checks on the input LSNs used by the functions of this extension. Author: Bharath Rupireddy, Michael Paquier Discussion: https://postgr.es/m/calj2acu0_q-o4dsweyaw9no1kbx-qkn6g_ozyqvpjf3czva...@mail.gmail.com Branch -- master Details

pgsql: Include headers of archive/ in installation

2023-03-10 Thread Michael Paquier
Include headers of archive/ in installation These new headers have been recently added in 35739b8, but they were not installed. Sravan has provided the patch for configure/make, while I have fixed the meson part. Author: Sravan Kumar, Michael Paquier Discussion: https://postgr.es/m/CA

pgsql: pg_walinspect: pg_get_wal_fpi_info() -> pg_get_wal_block_info()

2023-03-09 Thread Michael Paquier
man Author: Michael Paquier, Melanie Plageman, Bharath Rupireddy Discussion: https://postgr.es/m/caakru_borebdzmcv8v4czbzu8m_c6tdddbiphcz6i-iusxw...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/9ecb134a93f0a82540b0e0bed67b30d0c9eb836a Modified Fi

Re: pgsql: Run pgindent on libpq's fe-auth.c, fe-auth-scram.c and fe-connec

2023-03-09 Thread Michael Paquier
On Thu, Mar 09, 2023 at 10:34:12AM +0100, Alvaro Herrera wrote: > Please add this commit to .git-blame-ignore-revs. Thanks, done. -- Michael signature.asc Description: PGP signature

pgsql: Add b6dfee28 to .git-blame-ignore-revs

2023-03-09 Thread Michael Paquier
Add b6dfee28 to .git-blame-ignore-revs Thanks to Álvaro Herrera for the poke. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/d00a4ad1d56bbdbc032257803c0a97a583aec211 Modified Files -- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+)

pgsql: Run pgindent on libpq's fe-auth.c, fe-auth-scram.c and fe-connec

2023-03-08 Thread Michael Paquier
Run pgindent on libpq's fe-auth.c, fe-auth-scram.c and fe-connect.c A patch sent by Jacob Champion has been touching this area of the code, and the set of changes done in a9e9a9f has made a run of pgindent on these files a bit annoying to handle. So let's clean up a bit the area, first, to ease

pgsql: doc: Add guidelines to generate coverage reports with meson

2023-03-08 Thread Michael Paquier
doc: Add guidelines to generate coverage reports with meson These instructions were already available for configure-based builds, but not the meson-based builds. This commit closes the gap. Reviewed-by: Peter Eisentraut Discussion:

pgsql: Reflect normalization of query strings for utilities in pg_stat_

2023-03-07 Thread Michael Paquier
Reflect normalization of query strings for utilities in pg_stat_statements Applying normalization changes how the following query strings are reflected in pg_stat_statements, by showing Const nodes with a dollar-signed parameter as this is how such queries are structured internally once parsed: -

pgsql: Refine query jumbling handling for CallStmt

2023-03-07 Thread Michael Paquier
Refine query jumbling handling for CallStmt Previously, all the nodes of CallStmt were included in the jumbling, causing a duplicate in the computation as the transformed state of the CALL query was included as well as the parsed state (transformed FuncCall with all the input arguments and

pgsql: Ignore IntoClause.viewQuery in query jumbling

2023-03-07 Thread Michael Paquier
Ignore IntoClause.viewQuery in query jumbling IntoClause.viewQuery is a copy of the parsed-but-not-rewritten SELECT clause copied to IntoClause when transforming CreateTableAsStmt for a materialized view. Including a second copy of the SELECT Query into the query jumbling was leading to an

pgsql: Improve readability of code PROCESS_MAIN in vacuum_rel()

2023-03-07 Thread Michael Paquier
s we check for PROCESS_MAIN in a single place and then handle its subpaths, FULL or non-FULL vacuums. Some comments are added to make that clearer for the reader. Reported-by: Melanie Plageman Author: Nathan Bossart Reviewed-by: Michael Paquier, Melanie Plageman Discussion: https://p

pgsql: Make get_extension_schema() available

2023-03-06 Thread Michael Paquier
Make get_extension_schema() available This routine is able to retrieve the OID of the schema used with an extension (pg_extension.extnamespace), or InvalidOid if this information is not available. plpgsql_check embeds a copy of this code when performing checks on functions, as one out-of-core

pgsql: Improve cleanup phases in regression tests of pg_stat_statements

2023-03-06 Thread Michael Paquier
Improve cleanup phases in regression tests of pg_stat_statements As shaped, two DROP ROLE queries included in "user_activity" were showing in the reports for "wal". The intention is to keep each test isolated and independent, so this is incorrect. This commit adds some calls to

pgsql: Silence -Wmissing-braces complaints in file_utils.c

2023-03-06 Thread Michael Paquier
Silence -Wmissing-braces complaints in file_utils.c Per buildfarm member lapwing, coupled with an offline poke from Julien Rouhaud. 6392f2a was a similar case. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/d937904cce6a3d82e4f9c2127de7b59105a134b3 Modified Files

pgsql: Add PROCESS_MAIN to VACUUM

2023-03-05 Thread Michael Paquier
Add PROCESS_MAIN to VACUUM Disabling this option is useful to run VACUUM (with or without FULL) on only the toast table of a relation, bypassing the main relation. This option is enabled by default. Running directly VACUUM on a toast table was already possible without this feature, by using the

pgsql: Improve the regression tests of VACUUM (PROCESS_TOAST)

2023-03-05 Thread Michael Paquier
Improve the regression tests of VACUUM (PROCESS_TOAST) All the regression tests of VACUUM (PROCESS_TOAST) were only checking if the commands were able to run, without checking if VACUUM was really running on what it should. This expands this set of tests so as we now look at

pgsql: Revise pg_pwrite_zeros()

2023-03-05 Thread Michael Paquier
unction logic. Author: Andres Freund Reviewed-by: Michael Paquier, Bharath Rupireddy Discussion: https://postgr.es/m/20230215005525.mrrlmqrxzjzha...@awork3.anarazel.de Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/ce340e530d1f76367379a8d230ad5f411e5f25d2 Modified Fi

pgsql: Force testing of query jumbling in 027_stream_regress.pl

2023-03-02 Thread Michael Paquier
Force testing of query jumbling in 027_stream_regress.pl Coverage of the query jumbling code has always relied on the queries included in the regression tests of pg_stat_statements. This has its limitations, as a lot of query patterns have never really stressed the query jumbling code. The

pgsql: Refactor more the regression tests of pg_stat_statements

2023-03-02 Thread Michael Paquier
Refactor more the regression tests of pg_stat_statements This commit expands more the refactoring of the regression tests of pg_stat_statements, with tests moved out of pg_stat_statements.sql into separate files. The following file structure is now used: - select is mostly the former

pgsql: pageinspect: Fix crash with gist_page_items()

2023-03-01 Thread Michael Paquier
pageinspect: Fix crash with gist_page_items() Attempting to use this function with a raw page not coming from a GiST index would cause a crash, as it was missing the same sanity checks as gist_page_items_bytea(). This slightly refactors the code so as all the basic validation checks for GiST

pgsql: pageinspect: Fix crash with gist_page_items()

2023-03-01 Thread Michael Paquier
pageinspect: Fix crash with gist_page_items() Attempting to use this function with a raw page not coming from a GiST index would cause a crash, as it was missing the same sanity checks as gist_page_items_bytea(). This slightly refactors the code so as all the basic validation checks for GiST

pgsql: pageinspect: Fix crash with gist_page_items()

2023-03-01 Thread Michael Paquier
pageinspect: Fix crash with gist_page_items() Attempting to use this function with a raw page not coming from a GiST index would cause a crash, as it was missing the same sanity checks as gist_page_items_bytea(). This slightly refactors the code so as all the basic validation checks for GiST

pgsql: doc: Mention de-normalization of deallocated entries in pg_stat_

2023-02-28 Thread Michael Paquier
doc: Mention de-normalization of deallocated entries in pg_stat_statements The current implementation of query normalization in pg_stat_statements is optimistic. If an entry is deallocated between the post-analyze hook and the planner and/or execution hook, it can be possible to find query

pgsql: doc: Update pg_stat_statements about query ID calculation of uti

2023-02-28 Thread Michael Paquier
doc: Update pg_stat_statements about query ID calculation of utilities Since 3db72eb, the calculation of the query ID hash for utilities is not done based on the textual query strings, but on their internal Query representation, meaning that there can be an overlap when they use literal

pgsql: doc: Fix description of pg_get_wal_stats_till_end_of_wal() in pg

2023-02-28 Thread Michael Paquier
doc: Fix description of pg_get_wal_stats_till_end_of_wal() in pg_walinspect end_lsn was mentioned as an input parameter, but that should not be the case. Error introduced in 58597ed. Author: Nathan Bossart Discussion: https://postgr.es/m/20230228195740.GA1397484@nathanxps13 Backpatch-through:

pgsql: doc: Fix description of pg_get_wal_stats_till_end_of_wal() in pg

2023-02-28 Thread Michael Paquier
doc: Fix description of pg_get_wal_stats_till_end_of_wal() in pg_walinspect end_lsn was mentioned as an input parameter, but that should not be the case. Error introduced in 58597ed. Author: Nathan Bossart Discussion: https://postgr.es/m/20230228195740.GA1397484@nathanxps13 Backpatch-through:

pgsql: Fix expected output of xml_2.out

2023-02-27 Thread Michael Paquier
Fix expected output of xml_2.out Per buildfarm members snakefly, parula and prion, that reflect the results coming from the latest versions of libxml2. Oversight in b8da37b in the shape of an incorrect copy-paste. The CI was green, but it does not stress this expected output. Branch --

pgsql: Rework pg_input_error_message(), now renamed pg_input_error_info

2023-02-27 Thread Michael Paquier
Rework pg_input_error_message(), now renamed pg_input_error_info() pg_input_error_info() is now a SQL function able to return a row with more than just the error message generated for incorrect data type inputs when these are able to handle soft failures, returning more contents of ErrorData, as

pgsql: Fix small memory leak in psql's \bind command

2023-02-21 Thread Michael Paquier
Fix small memory leak in psql's \bind command psql_scan_slash_option() returns a malloc()'d result through a PQExpBuffer, and exec_command_bind() was doing an extra allocation of this option for no effect. Introduced in 5b66de3. Author: Kyotaro Horiguchi Reviewed-by: Corey Huinker Discussion:

pgsql: doc: Add missing values for meson options -Dcassert and -Db_cove

2023-02-21 Thread Michael Paquier
doc: Add missing values for meson options -Dcassert and -Db_coverage The -Dcassert and -Db_coverage that can be specified to a meson command require values after an equal sign but the documentation did not properly reflect that. All the other options specify the argument values they expect, so

pgsql: Fix corruption of templates after CREATE DATABASE .. STRATEGY WA

2023-02-21 Thread Michael Paquier
the issue, and Nathan has written a test able to reproduce the failure (with few tweaks from me). Backpatch down to 15, where STRATEGY = WAL_LOG has been introduced. Author: Nathan Bossart, Ryo Matsumura Reviewed-by: Dilip Kumar, Michael Paquier Discussion: https://postgr.es/m

pgsql: Fix corruption of templates after CREATE DATABASE .. STRATEGY WA

2023-02-21 Thread Michael Paquier
the issue, and Nathan has written a test able to reproduce the failure (with few tweaks from me). Backpatch down to 15, where STRATEGY = WAL_LOG has been introduced. Author: Nathan Bossart, Ryo Matsumura Reviewed-by: Dilip Kumar, Michael Paquier Discussion: https://postgr.es/m

pgsql: Fix handling of escape sequences in postgres_fdw.application_nam

2023-02-21 Thread Michael Paquier
der Lakhin Author: Kyotaro Horiguchi, Michael Paquier Reviewed-by: Hayato Kuroda, Masahiko Sawada Discussion: https://postgr.es/m/17789-8b31c5a4672b7...@postgresql.org Backpatch-through: 15 Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/

pgsql: Fix handling of escape sequences in postgres_fdw.application_nam

2023-02-21 Thread Michael Paquier
der Lakhin Author: Kyotaro Horiguchi, Michael Paquier Reviewed-by: Hayato Kuroda, Masahiko Sawada Discussion: https://postgr.es/m/17789-8b31c5a4672b7...@postgresql.org Backpatch-through: 15 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/8427ce4c379ee3774b8a9aca13ca7f

pgsql: Expand regression tests of pg_stat_statements for utility querie

2023-02-19 Thread Michael Paquier
Expand regression tests of pg_stat_statements for utility queries This commit adds more coverage for utility statements so as it is possible to track down all the effects of query normalization done for all the queries that use either Const or A_Const nodes, which are the nodes where

pgsql: Refactor tests of pg_stat_statements for planning, utility and l

2023-02-19 Thread Michael Paquier
Refactor tests of pg_stat_statements for planning, utility and level tracking pg_stat_statements.sql acts as the main file for all the core tests of the module, but things have become complicated to follow over the years as some of the sub-scenarios tested in this file rely on assumptions that

pgsql: Redesign archive modules

2023-02-16 Thread Michael Paquier
Redesign archive modules A new callback named startup_cb, called shortly after a module is loaded, is added. This makes possible the initialization of any additional state data required by a module. This initial state data can be saved in a ArchiveModuleState, that is now passed down to all the

pgsql: Remove duplicated comment in nodeModifyTable.c

2023-02-16 Thread Michael Paquier
Remove duplicated comment in nodeModifyTable.c Author: Amul Sul Discussion: https://postgr.es/m/CAAJ_b97badUU8_DHNoFCXZxF6YUk0Yb=53rrum168hd1haj...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/17feb6a566b77bf62ca453dec215adcc71755c20 Modified

pgsql: Add description for new patterns supported in HBA and ident samp

2023-02-15 Thread Michael Paquier
Add description for new patterns supported in HBA and ident sample files Support for regexps in database and role entries for pg_hba.conf has been added in 8fea8683, and efb6f4a has extended support of pg-user in pg_ident.conf, still both of them have missed a short description about the new

pgsql: doc: Fix spelling of option -Dtap_tests for meson

2023-02-14 Thread Michael Paquier
doc: Fix spelling of option -Dtap_tests for meson This option was documented as -Dtap-tests, but the option requires an underscore in its name. Author: Katsuragi Yuta Discussion: https://postgr.es/m/cff4558e170be78d8fd64ed45edbe...@oss.nttdata.com Branch -- master Details ---

pgsql: Fix handling of SCRAM-SHA-256's channel binding with RSA-PSS cer

2023-02-14 Thread Michael Paquier
Fix handling of SCRAM-SHA-256's channel binding with RSA-PSS certificates OpenSSL 1.1.1 and newer versions have added support for RSA-PSS certificates, which requires the use of a specific routine in OpenSSL to determine which hash function to use when compiling it when using channel binding in

pgsql: Fix handling of SCRAM-SHA-256's channel binding with RSA-PSS cer

2023-02-14 Thread Michael Paquier
Fix handling of SCRAM-SHA-256's channel binding with RSA-PSS certificates OpenSSL 1.1.1 and newer versions have added support for RSA-PSS certificates, which requires the use of a specific routine in OpenSSL to determine which hash function to use when compiling it when using channel binding in

pgsql: Fix handling of SCRAM-SHA-256's channel binding with RSA-PSS cer

2023-02-14 Thread Michael Paquier
Fix handling of SCRAM-SHA-256's channel binding with RSA-PSS certificates OpenSSL 1.1.1 and newer versions have added support for RSA-PSS certificates, which requires the use of a specific routine in OpenSSL to determine which hash function to use when compiling it when using channel binding in

pgsql: Fix handling of SCRAM-SHA-256's channel binding with RSA-PSS cer

2023-02-14 Thread Michael Paquier
Fix handling of SCRAM-SHA-256's channel binding with RSA-PSS certificates OpenSSL 1.1.1 and newer versions have added support for RSA-PSS certificates, which requires the use of a specific routine in OpenSSL to determine which hash function to use when compiling it when using channel binding in

pgsql: Fix handling of SCRAM-SHA-256's channel binding with RSA-PSS cer

2023-02-14 Thread Michael Paquier
Fix handling of SCRAM-SHA-256's channel binding with RSA-PSS certificates OpenSSL 1.1.1 and newer versions have added support for RSA-PSS certificates, which requires the use of a specific routine in OpenSSL to determine which hash function to use when compiling it when using channel binding in

pgsql: Fix handling of SCRAM-SHA-256's channel binding with RSA-PSS cer

2023-02-14 Thread Michael Paquier
Fix handling of SCRAM-SHA-256's channel binding with RSA-PSS certificates OpenSSL 1.1.1 and newer versions have added support for RSA-PSS certificates, which requires the use of a specific routine in OpenSSL to determine which hash function to use when compiling it when using channel binding in

pgsql: Mark more nodes with attribute no_query_jumble

2023-02-12 Thread Michael Paquier
Mark more nodes with attribute no_query_jumble This commit removes most of the Plan and Path nodes, which should never be included in the query jumbling because we ignore these in Query nodes. This is facilitated by making no_query_jumble an inherited attribute, like no_copy, no_equal and

pgsql: Fix typo in parsenodes.h

2023-02-09 Thread Michael Paquier
Fix typo in parsenodes.h Introduced in a61b1f7 when RTEPermissionInfo got added. Issue spotted while reviewing the area for a different patch. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/9e8b694d819d96f65f8de33102858bd6bff4b54a Modified Files --

pgsql: Properly NULL-terminate GSS receive buffer on error packet recep

2023-02-09 Thread Michael Paquier
Properly NULL-terminate GSS receive buffer on error packet reception pqsecure_open_gss() includes a code path handling error messages with v2-style protocol messages coming from the server. The client-side buffer holding the error message does not force a NULL-termination, with the data of the

pgsql: Properly NULL-terminate GSS receive buffer on error packet recep

2023-02-09 Thread Michael Paquier
Properly NULL-terminate GSS receive buffer on error packet reception pqsecure_open_gss() includes a code path handling error messages with v2-style protocol messages coming from the server. The client-side buffer holding the error message does not force a NULL-termination, with the data of the

pgsql: Properly NULL-terminate GSS receive buffer on error packet recep

2023-02-09 Thread Michael Paquier
Properly NULL-terminate GSS receive buffer on error packet reception pqsecure_open_gss() includes a code path handling error messages with v2-style protocol messages coming from the server. The client-side buffer holding the error message does not force a NULL-termination, with the data of the

pgsql: Properly NULL-terminate GSS receive buffer on error packet recep

2023-02-09 Thread Michael Paquier
Properly NULL-terminate GSS receive buffer on error packet reception pqsecure_open_gss() includes a code path handling error messages with v2-style protocol messages coming from the server. The client-side buffer holding the error message does not force a NULL-termination, with the data of the

pgsql: Properly NULL-terminate GSS receive buffer on error packet recep

2023-02-09 Thread Michael Paquier
Properly NULL-terminate GSS receive buffer on error packet reception pqsecure_open_gss() includes a code path handling error messages with v2-style protocol messages coming from the server. The client-side buffer holding the error message does not force a NULL-termination, with the data of the

pgsql: Fix various typos in code and tests

2023-02-08 Thread Michael Paquier
Fix various typos in code and tests Most of these are recent, and the documentation portions are new as of v16 so there is no need for a backpatch. Author: Justin Pryzby Discussion: https://postgr.es/m/20230208155644.gm1...@telsasoft.com Branch -- master Details ---

pgsql: Remove SQL regression tests for GUCs related to NO_SHOW_ALL

2023-02-07 Thread Michael Paquier
Remove SQL regression tests for GUCs related to NO_SHOW_ALL No GUCs that use NO_SHOW_ALL are reported in pg_show_all_settings(), hence trying to check combinations of flags related to it is pointless. These queries have been introduced by d10e41d, so backpatch down to 15 to keep all the branches

pgsql: Remove SQL regression tests for GUCs related to NO_SHOW_ALL

2023-02-07 Thread Michael Paquier
Remove SQL regression tests for GUCs related to NO_SHOW_ALL No GUCs that use NO_SHOW_ALL are reported in pg_show_all_settings(), hence trying to check combinations of flags related to it is pointless. These queries have been introduced by d10e41d, so backpatch down to 15 to keep all the branches

pgsql: Make EXEC_BACKEND more convenient on Linux and FreeBSD.

2023-02-07 Thread Michael Paquier
Make EXEC_BACKEND more convenient on Linux and FreeBSD. Try to disable ASLR when building in EXEC_BACKEND mode, to avoid random memory mapping failures while testing. For developer use only, no effect on regular builds. This has been originally applied as of f3e7806 for v15~, but recently-added

pgsql: Make EXEC_BACKEND more convenient on Linux and FreeBSD.

2023-02-07 Thread Michael Paquier
Make EXEC_BACKEND more convenient on Linux and FreeBSD. Try to disable ASLR when building in EXEC_BACKEND mode, to avoid random memory mapping failures while testing. For developer use only, no effect on regular builds. This has been originally applied as of f3e7806 for v15~, but recently-added

pgsql: Make EXEC_BACKEND more convenient on Linux and FreeBSD.

2023-02-07 Thread Michael Paquier
Make EXEC_BACKEND more convenient on Linux and FreeBSD. Try to disable ASLR when building in EXEC_BACKEND mode, to avoid random memory mapping failures while testing. For developer use only, no effect on regular builds. This has been originally applied as of f3e7806 for v15~, but recently-added

pgsql: Include values of A_Const nodes in query jumbling

2023-02-06 Thread Michael Paquier
Include values of A_Const nodes in query jumbling Like the implementation for node copy, write and read, this node requires a custom implementation so as the query jumbling is able to consider the correct value assigned to it, depending on its type (int, float, bool, string, bitstring). Based on

pgsql: Extend check_GUC_init() with checks on flag combinations when lo

2023-02-05 Thread Michael Paquier
Extend check_GUC_init() with checks on flag combinations when loading GUCs This extends the work begun by a73952b, with the addition of a GUC check for flag combinations in check_GUC_init(), making sure that anything defined with GUC_NO_SHOW_ALL also includes GUC_NOT_IN_SAMPLE, as first step.

pgsql: Add support for progress reporting to pg_verifybackup

2023-02-05 Thread Michael Paquier
Add support for progress reporting to pg_verifybackup This adds a new option to pg_verifybackup called -P/--progress, showing every second some information about the progress of the checksum verification based on the data of a backup manifest. Similarly to what is done for pg_rewind and

pgsql: Revert refactoring of restore command code to shell_restore.c

2023-02-05 Thread Michael Paquier
Revert refactoring of restore command code to shell_restore.c This reverts commits 24c35ec and 57169ad. PreRestoreCommand() and PostRestoreCommand() need to be put closer to the system() call calling a restore_command, as they enable in_restore_command for the startup process which would in turn

pgsql: Simplify main waiting loop of the archiver process

2023-01-31 Thread Michael Paquier
Simplify main waiting loop of the archiver process As coded, the timeout given to WaitLatch() was always equal to PGARCH_AUTOWAKE_INTERVAL, as time() was called two times repeatedly. This simplification could have been done in d75288f. While on it, this adjusts a comment in pgarch.c to describe

pgsql: Generate code for query jumbling through gen_node_support.pl

2023-01-30 Thread Michael Paquier
per query post-parse analysis. Author: Michael Paquier Reviewed-by: Peter Eisentraut Discussion: https://postgr.es/m/Y5BHOUhX3zTH/i...@paquier.xyz Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3db72ebcbe20debc6552500ee9ccb4b2007f12f8 Modified Fil

pgsql: Remove recovery test 011_crash_recovery.pl

2023-01-30 Thread Michael Paquier
Remove recovery test 011_crash_recovery.pl This test has been added as of 857ee8e that has introduced the SQL function txid_status(), with the purpose of checking that a transaction ID still in-progress during a crash is correctly marked as aborted after recovery finishes. This test is unstable,

pgsql: Remove recovery test 011_crash_recovery.pl

2023-01-30 Thread Michael Paquier
Remove recovery test 011_crash_recovery.pl This test has been added as of 857ee8e that has introduced the SQL function txid_status(), with the purpose of checking that a transaction ID still in-progress during a crash is correctly marked as aborted after recovery finishes. This test is unstable,

pgsql: Remove recovery test 011_crash_recovery.pl

2023-01-30 Thread Michael Paquier
Remove recovery test 011_crash_recovery.pl This test has been added as of 857ee8e that has introduced the SQL function txid_status(), with the purpose of checking that a transaction ID still in-progress during a crash is correctly marked as aborted after recovery finishes. This test is unstable,

pgsql: Remove recovery test 011_crash_recovery.pl

2023-01-30 Thread Michael Paquier
Remove recovery test 011_crash_recovery.pl This test has been added as of 857ee8e that has introduced the SQL function txid_status(), with the purpose of checking that a transaction ID still in-progress during a crash is correctly marked as aborted after recovery finishes. This test is unstable,

pgsql: Remove recovery test 011_crash_recovery.pl

2023-01-30 Thread Michael Paquier
Remove recovery test 011_crash_recovery.pl This test has been added as of 857ee8e that has introduced the SQL function txid_status(), with the purpose of checking that a transaction ID still in-progress during a crash is correctly marked as aborted after recovery finishes. This test is unstable,

pgsql: Remove recovery test 011_crash_recovery.pl

2023-01-30 Thread Michael Paquier
Remove recovery test 011_crash_recovery.pl This test has been added as of 857ee8e that has introduced the SQL function txid_status(), with the purpose of checking that a transaction ID still in-progress during a crash is correctly marked as aborted after recovery finishes. This test is unstable,

Re: pgsql: Adjust interaction of CREATEROLE with role properties.

2023-01-27 Thread Michael Paquier
On Fri, Jan 27, 2023 at 10:46:53AM -0500, Tom Lane wrote: > I was imagining that pg_regress could contain a function that > issues some predefined queries and complains if the results > aren't empty. It already has the ability to issue commands > to the cluster-under-test (for the initial CREATE

Re: pgsql: Adjust interaction of CREATEROLE with role properties.

2023-01-26 Thread Michael Paquier
On Thu, Jan 26, 2023 at 09:08:23PM -0500, Tom Lane wrote: > Yeah ... if we put it into an existing script, somebody will blindly > add more tests after it someday. I suggest calling it "test_cleanup" > to pair with "test_setup". > > Is it worth checking for leftover regress_xxx tablespaces as

pgsql: Fix behavior with pg_restore -l and compressed dumps

2023-01-26 Thread Michael Paquier
Fix behavior with pg_restore -l and compressed dumps pg_restore -l has always been able to read the TOC data of a dump even if its binary has no support for compression, for both compressed and uncompressed dumps. 5e73a60 has introduced a backward-incompatible behavior by switching a warning to

Re: pgsql: Adjust interaction of CREATEROLE with role properties.

2023-01-26 Thread Michael Paquier
On Thu, Jan 26, 2023 at 12:31:06PM -0600, Justin Pryzby wrote: > On Thu, Jan 26, 2023 at 09:46:07AM -0500, Andrew Dunstan wrote: >> Would it be worth adding a check right at the end of the schedule that >> makes sure there are no such roles left? > > Yes, because the alternative is to have cirrus

pgsql: Make auto_explain print the query identifier in verbose mode

2023-01-25 Thread Michael Paquier
Make auto_explain print the query identifier in verbose mode When auto_explain.log_verbose is on, auto_explain should print in the logs plans equivalent to the EXPLAIN (VERBOSE). However, when compute_query_id is on, query identifiers were not showing up, being only handled by EXPLAIN (VERBOSE).

<    3   4   5   6   7   8   9   10   11   12   >