pgsql: Fix path reference when parsing pg_ident.conf for pg_ident_file_

2022-07-25 Thread Michael Paquier
Fix path reference when parsing pg_ident.conf for pg_ident_file_mappings Since a2c8499, HbaFileName (default pg_hba.conf) was getting used instead of IdentFileName (default pg_ident.conf) as the parent file to use as reference when parsing the contents of pg_ident.conf, with pg_ident.conf correctl

pgsql: Fix path reference when parsing pg_ident.conf for pg_ident_file_

2022-07-25 Thread Michael Paquier
Fix path reference when parsing pg_ident.conf for pg_ident_file_mappings Since a2c8499, HbaFileName (default pg_hba.conf) was getting used instead of IdentFileName (default pg_ident.conf) as the parent file to use as reference when parsing the contents of pg_ident.conf, with pg_ident.conf correctl

pgsql: Eliminate duplicate code in table.c.

2022-07-25 Thread Amit Kapila
Eliminate duplicate code in table.c. Additionally improve the error message similar to how it was done in 2ed532ee8c. Author: Junwang Zhao, Aleksander Alekseev Reviewed-by: Amit Kapila, Alvaro Herrera, Kyotaro Horiguchi Discussion: https://postgr.es/m/CAEG8a3KbVtBm_BYf5tGsKHvmMieQVsq_jBPOg75VViQ

pgsql: Fix a few issues with REINDEX grammar

2022-07-25 Thread Michael Paquier
Fix a few issues with REINDEX grammar This addresses a couple of bugs in the REINDEX grammar, introduced by 83011ce: - A name was never specified for DATABASE/SYSTEM, even if the query included one. This caused such REINDEX queries to always work with any object name, but we should complain if th

pgsql: Add test for session_preload_libraries and parameter permissions

2022-07-25 Thread Tom Lane
Add test for session_preload_libraries and parameter permissions checks. We weren't exercising the session_preload_libraries option in any meaningful way. auto_explain is a good testbed for doing so, since it's one of the primary use-cases for session_preload_libraries. Hence, adjust its TAP test

pgsql: Add test for session_preload_libraries and parameter permissions

2022-07-25 Thread Tom Lane
Add test for session_preload_libraries and parameter permissions checks. We weren't exercising the session_preload_libraries option in any meaningful way. auto_explain is a good testbed for doing so, since it's one of the primary use-cases for session_preload_libraries. Hence, adjust its TAP test

pgsql: Add xheader_width pset option to psql

2022-07-25 Thread Andrew Dunstan
Add xheader_width pset option to psql The setting controls tha maximum length of the header line in expanded format output. Possible settings are full, column, page, or an integer. the default is full, the current behaviour, and in this case the header line is the length of the widest line of outp

pgsql: Process session_preload_libraries within InitPostgres's transact

2022-07-25 Thread Tom Lane
Process session_preload_libraries within InitPostgres's transaction. Previously we did this after InitPostgres, at a somewhat randomly chosen place within PostgresMain. However, since commit a0ffa885e doing this outside a transaction can cause a crash, if we need to check permissions while replac

pgsql: Process session_preload_libraries within InitPostgres's transact

2022-07-25 Thread Tom Lane
Process session_preload_libraries within InitPostgres's transaction. Previously we did this after InitPostgres, at a somewhat randomly chosen place within PostgresMain. However, since commit a0ffa885e doing this outside a transaction can cause a crash, if we need to check permissions while replac