pgsql: Fix typo in recently-added TAP test for replication slots

2020-01-30 Thread Michael Paquier
Fix typo in recently-added TAP test for replication slots Oversight in commit b0afdca. Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/8b29c75f6297a595722ce4c012dad60f77448d85 Modified Files -- src/test/recovery/t/006_logical_decoding.pl | 2 +- 1

pgsql: Fix typo in recently-added TAP test for replication slots

2020-01-30 Thread Michael Paquier
Fix typo in recently-added TAP test for replication slots Oversight in commit b0afdca. Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/706ad6a4df3aa04a83fea07d907057d379f04d40 Modified Files -- src/test/recovery/t/006_logical_decoding.pl | 2 +- 1

pgsql: Fix typo in recently-added TAP test for replication slots

2020-01-30 Thread Michael Paquier
Fix typo in recently-added TAP test for replication slots Oversight in commit b0afdca. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/7ca8c9706a5785feef5d5eff0078c5361694b274 Modified Files -- src/test/recovery/t/006_logical_decoding.pl | 2 +- 1 file c

pgsql: Adjust DSM and DSA slot usage constants.

2020-01-30 Thread Thomas Munro
Adjust DSM and DSA slot usage constants. When running a lot of large parallel queries concurrently, or a plan with a lot of separate Gather nodes, it is possible to run out of DSM slots. There are better solutions to these problems requiring architectural redesign work, but for now, let's adjust t

pgsql: Report time spent in posix_fallocate() as a wait event.

2020-01-30 Thread Thomas Munro
Report time spent in posix_fallocate() as a wait event. When allocating DSM segments with posix_fallocate() on Linux (see commit 899bd785), report this activity as a wait event exactly as we would if we were using file-backed DSM rather than shm_open()-backed DSM. Author: Thomas Munro Discussion:

pgsql: In jsonb_plpython.c, suppress warning message from gcc 10.

2020-01-30 Thread Tom Lane
In jsonb_plpython.c, suppress warning message from gcc 10. Very recent gcc complains that PLyObject_ToJsonbValue could return a pointer to a local variable. I think it's wrong; but the coding is fragile enough, and the savings of one palloc() minimal enough, that it seems better to just do a pall

pgsql: In jsonb_plpython.c, suppress warning message from gcc 10.

2020-01-30 Thread Tom Lane
In jsonb_plpython.c, suppress warning message from gcc 10. Very recent gcc complains that PLyObject_ToJsonbValue could return a pointer to a local variable. I think it's wrong; but the coding is fragile enough, and the savings of one palloc() minimal enough, that it seems better to just do a pall

pgsql: In jsonb_plpython.c, suppress warning message from gcc 10.

2020-01-30 Thread Tom Lane
In jsonb_plpython.c, suppress warning message from gcc 10. Very recent gcc complains that PLyObject_ToJsonbValue could return a pointer to a local variable. I think it's wrong; but the coding is fragile enough, and the savings of one palloc() minimal enough, that it seems better to just do a pall

pgsql: Handle lack of DSM slots in parallel btree build.

2020-01-30 Thread Thomas Munro
Handle lack of DSM slots in parallel btree build. If no DSM slots are available, a ParallelContext can still be created, but its seg pointer is NULL. Teach parallel btree build to cope with that by falling back to a regular non-parallel build, to avoid crashing with a segmentation fault. Back-pa

pgsql: Handle lack of DSM slots in parallel btree build.

2020-01-30 Thread Thomas Munro
Handle lack of DSM slots in parallel btree build. If no DSM slots are available, a ParallelContext can still be created, but its seg pointer is NULL. Teach parallel btree build to cope with that by falling back to a regular non-parallel build, to avoid crashing with a segmentation fault. Back-pa

pgsql: Handle lack of DSM slots in parallel btree build.

2020-01-30 Thread Thomas Munro
Handle lack of DSM slots in parallel btree build. If no DSM slots are available, a ParallelContext can still be created, but its seg pointer is NULL. Teach parallel btree build to cope with that by falling back to a regular non-parallel build, to avoid crashing with a segmentation fault. Back-pa

Re: pgsql: Add reusable routine for making arrays unique.

2020-01-30 Thread Alvaro Herrera
On 2020-Jan-06, Michael Paquier wrote: > On Sun, Jan 05, 2020 at 05:46:48PM -0800, Peter Geoghegan wrote: > > On Sun, Jan 5, 2020 at 5:39 PM Alvaro Herrera > > wrote: > >> I think the easiest is to state that all files, even new files are > >> Portions (c) each of these entities, period. Tryin

pgsql: Clean up newlines following left parentheses

2020-01-30 Thread Alvaro Herrera
Clean up newlines following left parentheses We used to strategically place newlines after some function call left parentheses to make pgindent move the argument list a few chars to the left, so that the whole line would fit under 80 chars. However, pgindent no longer does that, so the newlines j

pgsql: Remove excess parens in ereport() calls

2020-01-30 Thread Alvaro Herrera
Remove excess parens in ereport() calls Cosmetic cleanup, not worth backpatching. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Tom Lane, Michael Paquier Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4e89c79a52f8a898edd648b56a0

pgsql: Fix test failure with non-MULTIPLICITY Perl interpreters.

2020-01-30 Thread Tom Lane
Fix test failure with non-MULTIPLICITY Perl interpreters. Per buildfarm. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2520cf8c2a0a1d679094dffbd99871884e620ed5 Modified Files -- src/pl/plperl/expected/plperl_setup.out | 3 +++ src/pl/plperl/sql/plperl_

pgsql: Make inherited TRUNCATE perform access permission checks on pare

2020-01-30 Thread Fujii Masao
Make inherited TRUNCATE perform access permission checks on parent table only. Previously, TRUNCATE command through a parent table checked the permissions on not only the parent table but also the children tables inherited from it. This was a bug and inherited queries should perform access permiss

pgsql: Make inherited TRUNCATE perform access permission checks on pare

2020-01-30 Thread Fujii Masao
Make inherited TRUNCATE perform access permission checks on parent table only. Previously, TRUNCATE command through a parent table checked the permissions on not only the parent table but also the children tables inherited from it. This was a bug and inherited queries should perform access permiss

pgsql: Make inherited TRUNCATE perform access permission checks on pare

2020-01-30 Thread Fujii Masao
Make inherited TRUNCATE perform access permission checks on parent table only. Previously, TRUNCATE command through a parent table checked the permissions on not only the parent table but also the children tables inherited from it. This was a bug and inherited queries should perform access permiss

pgsql: Make inherited TRUNCATE perform access permission checks on pare

2020-01-30 Thread Fujii Masao
Make inherited TRUNCATE perform access permission checks on parent table only. Previously, TRUNCATE command through a parent table checked the permissions on not only the parent table but also the children tables inherited from it. This was a bug and inherited queries should perform access permiss

pgsql: Make inherited TRUNCATE perform access permission checks on pare

2020-01-30 Thread Fujii Masao
Make inherited TRUNCATE perform access permission checks on parent table only. Previously, TRUNCATE command through a parent table checked the permissions on not only the parent table but also the children tables inherited from it. This was a bug and inherited queries should perform access permiss

pgsql: Make inherited TRUNCATE perform access permission checks on pare

2020-01-30 Thread Fujii Masao
Make inherited TRUNCATE perform access permission checks on parent table only. Previously, TRUNCATE command through a parent table checked the permissions on not only the parent table but also the children tables inherited from it. This was a bug and inherited queries should perform access permiss

pgsql: Make inherited TRUNCATE perform access permission checks on pare

2020-01-30 Thread Fujii Masao
Make inherited TRUNCATE perform access permission checks on parent table only. Previously, TRUNCATE command through a parent table checked the permissions on not only the parent table but also the children tables inherited from it. This was a bug and inherited queries should perform access permiss

Re: pgsql: Invent "trusted" extensions, and remove the pg_pltemplate catalo

2020-01-30 Thread Tom Lane
Michael Paquier writes: > On Wed, Jan 29, 2020 at 11:43:16PM +, Tom Lane wrote: >> Invent "trusted" extensions, and remove the pg_pltemplate catalog. > morepork, prairiedog and curculio are complaining with the test > plperl_setup: Yeah, I'm on it. I figure I can fix this without breaking t