pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode

2021-03-17 Thread Amit Kapila
Add a new GUC and a reloption to enable inserts in parallel-mode. Commit 05c8482f7f added the implementation of parallel SELECT for "INSERT INTO ... SELECT ..." which may incur non-negligible overhead in the additional parallel-safety checks that it performs, even when, in the end, those checks de

pgsql: Fix memory lifetime issues of replication slot stats.

2021-03-17 Thread Andres Freund
Fix memory lifetime issues of replication slot stats. When accessing replication slot stats, introduced in 98681675002d, pgstat_read_statsfiles() reads the data into newly allocated memory. Unfortunately the current memory context at that point is the callers, leading to leaks and use-after-free d

pgsql: Doc: remove duplicated step in RLS example.

2021-03-17 Thread Tom Lane
Doc: remove duplicated step in RLS example. Seems to have been a copy-and-paste mistake in 093129c9d. Per report from [email protected]. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg

pgsql: Prevent buffer overrun in read_tablespace_map().

2021-03-17 Thread Tom Lane
Prevent buffer overrun in read_tablespace_map(). Robert Foggia of Trustwave reported that read_tablespace_map() fails to prevent an overrun of its on-stack input buffer. Since the tablespace map file is presumed trustworthy, this does not seem like an interesting security vulnerability, but still

pgsql: Prevent buffer overrun in read_tablespace_map().

2021-03-17 Thread Tom Lane
Prevent buffer overrun in read_tablespace_map(). Robert Foggia of Trustwave reported that read_tablespace_map() fails to prevent an overrun of its on-stack input buffer. Since the tablespace map file is presumed trustworthy, this does not seem like an interesting security vulnerability, but still

pgsql: Prevent buffer overrun in read_tablespace_map().

2021-03-17 Thread Tom Lane
Prevent buffer overrun in read_tablespace_map(). Robert Foggia of Trustwave reported that read_tablespace_map() fails to prevent an overrun of its on-stack input buffer. Since the tablespace map file is presumed trustworthy, this does not seem like an interesting security vulnerability, but still

pgsql: Code review for server's handling of "tablespace map" files.

2021-03-17 Thread Tom Lane
Code review for server's handling of "tablespace map" files. While looking at Robert Foggia's report, I noticed a passel of other issues in the same area: * The scheme for backslash-quoting newlines in pathnames is just wrong; it will misbehave if the last ordinary character in a pathname is a ba

pgsql: Add end-to-end testing of pg_basebackup's tar-format output.

2021-03-17 Thread Tom Lane
Add end-to-end testing of pg_basebackup's tar-format output. The existing test script does run pg_basebackup with the -Ft option, but it makes no real attempt to verify the sanity of the results. We wouldn't know if the output is incompatible with standard "tar" programs, nor if the server fails t

pgsql: Prevent buffer overrun in read_tablespace_map().

2021-03-17 Thread Tom Lane
Prevent buffer overrun in read_tablespace_map(). Robert Foggia of Trustwave reported that read_tablespace_map() fails to prevent an overrun of its on-stack input buffer. Since the tablespace map file is presumed trustworthy, this does not seem like an interesting security vulnerability, but still

pgsql: Prevent buffer overrun in read_tablespace_map().

2021-03-17 Thread Tom Lane
Prevent buffer overrun in read_tablespace_map(). Robert Foggia of Trustwave reported that read_tablespace_map() fails to prevent an overrun of its on-stack input buffer. Since the tablespace map file is presumed trustworthy, this does not seem like an interesting security vulnerability, but still

pgsql: Prevent buffer overrun in read_tablespace_map().

2021-03-17 Thread Tom Lane
Prevent buffer overrun in read_tablespace_map(). Robert Foggia of Trustwave reported that read_tablespace_map() fails to prevent an overrun of its on-stack input buffer. Since the tablespace map file is presumed trustworthy, this does not seem like an interesting security vulnerability, but still

pgsql: Doc: improve discussion of variable substitution in PL/pgSQL.

2021-03-17 Thread Tom Lane
Doc: improve discussion of variable substitution in PL/pgSQL. This was a bit disjointed, partly because of a not-well-considered decision to document SQL commands that don't return result rows as though they had nothing in common with commands that do. Rearrange so that we have one discussion of

pgsql: Revert "Fix race in Parallel Hash Join batch cleanup."

2021-03-17 Thread Thomas Munro
Revert "Fix race in Parallel Hash Join batch cleanup." This reverts commit 0129c56fbe5c26bfec91bfc2c8a3b8818f441d6e. Discussion: https://postgr.es/m/CA%2BhUKGJmcqAE3MZeDCLLXa62cWM0AJbKmp2JrJYaJ86bz36LFA%40mail.gmail.com Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/

pgsql: Revert "Fix race in Parallel Hash Join batch cleanup."

2021-03-17 Thread Thomas Munro
Revert "Fix race in Parallel Hash Join batch cleanup." This reverts commit 8fa2478b407ef867d501fafcdea45fd827f70799. Discussion: https://postgr.es/m/CA%2BhUKGJmcqAE3MZeDCLLXa62cWM0AJbKmp2JrJYaJ86bz36LFA%40mail.gmail.com Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/

pgsql: Revert "Fix race in Parallel Hash Join batch cleanup."

2021-03-17 Thread Thomas Munro
Revert "Fix race in Parallel Hash Join batch cleanup." This reverts commit 4e0f0995e923948631c4114ab353b256b51b58ad. Discussion: https://postgr.es/m/CA%2BhUKGJmcqAE3MZeDCLLXa62cWM0AJbKmp2JrJYaJ86bz36LFA%40mail.gmail.com Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/

pgsql: Revert "Fix race in Parallel Hash Join batch cleanup."

2021-03-17 Thread Thomas Munro
Revert "Fix race in Parallel Hash Join batch cleanup." This reverts commit 378802e3713c6c0fce31d2390c134cd5d7c30157. This reverts commit 3b8981b6e1a2aea0f18384c803e21e9391de669a. Discussion: https://postgr.es/m/CA%2BhUKGJmcqAE3MZeDCLLXa62cWM0AJbKmp2JrJYaJ86bz36LFA%40mail.gmail.com Branch --

pgsql: Fix comment in indexing.c

2021-03-17 Thread Michael Paquier
Fix comment in indexing.c 578b229, that removed support for WITH OIDS, has changed CatalogTupleInsert() to not return an Oid, but one comment was still mentioning that. Author: Vik Fearing Discussion: https://postgr.es/m/[email protected] Branch -- mas

pgsql: Small error message improvement

2021-03-17 Thread Peter Eisentraut
Small error message improvement Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/e1ae40f381d0582981b1e63856bd4b060cfe2d53 Modified Files -- src/backend/commands/tablecmds.c | 2 +- src/test/regress/expected/foreign_data.out | 4 ++-- 2 files chang