pgsql: Correct some uses of e.g. and i.e. in message strings and docume

2022-07-20 Thread John Naylor
Correct some uses of e.g. and i.e. in message strings and documentation E.g. means "for example" and i.e. means "that is". Fix a couple uses that don't match the intended meaning. Kyotaro Horiguchi Reviewed by Junwang Zhao and Aleksander Alekseev, with one addition by me Discussion:

pgsql: Allow users to skip logical replication of data having origin.

2022-07-20 Thread Amit Kapila
Allow users to skip logical replication of data having origin. This patch adds a new SUBSCRIPTION parameter "origin". It specifies whether the subscription will request the publisher to only send changes that don't have an origin or send changes regardless of origin. Setting it to "none" means

pgsql: docs: Improve pg_settings_get_flags docs.

2022-07-20 Thread Fujii Masao
docs: Improve pg_settings_get_flags docs. In the docs, the GUC flags that pg_settings_get_flags() reported were listed using . But the list was treated as separate lines in the existing function table and didn't look good. For better view, this commit separates the list from the table entry for

pgsql: Tweak a bit the new TAP tests of REINDEX DATABASE/SYSTEM

2022-07-20 Thread Michael Paquier
Tweak a bit the new TAP tests of REINDEX DATABASE/SYSTEM This renames the relation storing the relfilenode state into something more generic as it also stores data for non-toast relations. A restriction on the number of digits used for the OID number when filtering toast relation names is

pgsql: Fix various memory leaks in psql's describe commands \d*

2022-07-20 Thread Michael Paquier
Fix various memory leaks in psql's describe commands \d* Most of these have been introduced in d2d3547 with the new pattern validation logic, and would leak memory worth an amount of one PQExpBuffer each time (as of 256 bytes at minimum, possibly more). Most of the patch has been written by Tang

pgsql: Fix various memory leaks in psql's describe commands \d*

2022-07-20 Thread Michael Paquier
Fix various memory leaks in psql's describe commands \d* Most of these have been introduced in d2d3547 with the new pattern validation logic, and would leak memory worth an amount of one PQExpBuffer each time (as of 256 bytes at minimum, possibly more). Most of the patch has been written by Tang

pgsql: Dump more fields when dumping planner internal data structures.

2022-07-20 Thread Tom Lane
Dump more fields when dumping planner internal data structures. Commit 964d01ae9 marked a lot of fields as read_write_ignore to stay consistent with what was dumped by the manually-maintained outfuncs.c code. However, it seems that a pretty fair number of those omissions were either flat-out

pgsql: Process shared_preload_libraries in single-user mode.

2022-07-20 Thread Jeff Davis
Process shared_preload_libraries in single-user mode. Without processing shared_preload_libraries, it's impossible to recover if custom WAL resource managers are needed. It may also pose a problem running VACUUM on a table with a custom AM, if the module implementing the AM is expecting to be

pgsql: Process shared_preload_libraries in single-user mode.

2022-07-20 Thread Jeff Davis
Process shared_preload_libraries in single-user mode. Without processing shared_preload_libraries, it's impossible to recover if custom WAL resource managers are needed. It may also pose a problem running VACUUM on a table with a custom AM, if the module implementing the AM is expecting to be

pgsql: Make serialization of Nodes' scalar-array fields more robust.

2022-07-20 Thread Tom Lane
Make serialization of Nodes' scalar-array fields more robust. When the ability to print variable-length-array fields was first added to outfuncs.c, there was no corresponding read capability, as it was used only for debug dumps of planner-internal Nodes. Not a lot of thought seems to have been

pgsql: Document the ability to specify TableAM for pgbench

2022-07-20 Thread Alexander Korotkov
Document the ability to specify TableAM for pgbench Upcoming custom Table Access Methods (TableAM) need benchmarking. Despite pgbench doesn't have an explicit option for TableAM specification, one can specify it using PGOPTION environmental variable. The present commit documents this way to

pgsql: Add wal_sync_method=fdatasync for Windows.

2022-07-20 Thread Thomas Munro
Add wal_sync_method=fdatasync for Windows. Windows 10 gained support for flushing NTFS files with fdatasync() semantics. The main advantage over open_datasync (in Windows API terms FILE_FLAG_WRITE_THROUGH) is that the latter does not flush SATA drive caches. The default setting is not changed,

pgsql: Make subquery aliases optional in the FROM clause.

2022-07-20 Thread Dean Rasheed
Make subquery aliases optional in the FROM clause. This allows aliases for sub-SELECTs and VALUES clauses in the FROM clause to be omitted. This is an extension of the SQL standard, supported by some other database systems, and so eases the transition from such systems, as well as removing the

pgsql: Add PGDLLEXPORTS to some plpgsql function declarations

2022-07-20 Thread Alvaro Herrera
Add PGDLLEXPORTS to some plpgsql function declarations After -fvisibility=hidden was added by 089480c07705, plpgsql_check no longer works; this quick hack fixes it. It would be better to restructure the plpgsql.h header so that this doesn't look as random, but we can leave that for another day.