pgsql: Handle no replica identity index case in RelationGetIdentityKeyB

2021-06-18 Thread Amit Kapila
Handle no replica identity index case in RelationGetIdentityKeyBitmap. Commit e7eea52b2d has introduced a new function RelationGetIdentityKeyBitmap which omits to handle the case where there is no replica identity index on a relation. Author: Mark Dilger Reviewed-by: Takamichi Osumi, Amit Kapila

pgsql: Support disabling index bypassing by VACUUM.

2021-06-18 Thread Peter Geoghegan
Support disabling index bypassing by VACUUM. Generalize the INDEX_CLEANUP VACUUM parameter (and the corresponding reloption): make it into a ternary style boolean parameter. It now exposes a third option, "auto". The "auto" option (which is now the default) enables the "bypass index vacuuming" o

Re: pgsql: Fix misbehavior of DROP OWNED BY with duplicate polroles entries

2021-06-18 Thread Tom Lane
Michael Paquier writes: > This indentation is incorrect. Yeah, I intentionally didn't reindent the code that's now inside the inner if-block. It would have made back-patching more painful (because that chunk isn't identical across branches). And I think we're going to be rewriting that whole fu

Re: pgsql: Fix misbehavior of DROP OWNED BY with duplicate polroles entries

2021-06-18 Thread Michael Paquier
On Fri, Jun 18, 2021 at 10:00:33PM +, Tom Lane wrote: > Fix misbehavior of DROP OWNED BY with duplicate polroles entries. > > Ordinarily, a pg_policy.polroles array wouldn't list the same role > more than once; but CREATE POLICY does not prevent that. If we > perform DROP OWNED BY on a role t

pgsql: Add test case for obsoleting slot with active walsender

2021-06-18 Thread Alvaro Herrera
Add test case for obsoleting slot with active walsender The code to signal a running walsender when its reserved WAL size grows too large is completely uncovered before this commit; this adds coverage for that case. This test involves sending SIGSTOP to walsender and walreceiver and running a che

pgsql: Fix misbehavior of DROP OWNED BY with duplicate polroles entries

2021-06-18 Thread Tom Lane
Fix misbehavior of DROP OWNED BY with duplicate polroles entries. Ordinarily, a pg_policy.polroles array wouldn't list the same role more than once; but CREATE POLICY does not prevent that. If we perform DROP OWNED BY on a role that is listed more than once, RemoveRoleFromObjectPolicy either suff

pgsql: Fix misbehavior of DROP OWNED BY with duplicate polroles entries

2021-06-18 Thread Tom Lane
Fix misbehavior of DROP OWNED BY with duplicate polroles entries. Ordinarily, a pg_policy.polroles array wouldn't list the same role more than once; but CREATE POLICY does not prevent that. If we perform DROP OWNED BY on a role that is listed more than once, RemoveRoleFromObjectPolicy either suff

pgsql: Fix misbehavior of DROP OWNED BY with duplicate polroles entries

2021-06-18 Thread Tom Lane
Fix misbehavior of DROP OWNED BY with duplicate polroles entries. Ordinarily, a pg_policy.polroles array wouldn't list the same role more than once; but CREATE POLICY does not prevent that. If we perform DROP OWNED BY on a role that is listed more than once, RemoveRoleFromObjectPolicy either suff

pgsql: Fix misbehavior of DROP OWNED BY with duplicate polroles entries

2021-06-18 Thread Tom Lane
Fix misbehavior of DROP OWNED BY with duplicate polroles entries. Ordinarily, a pg_policy.polroles array wouldn't list the same role more than once; but CREATE POLICY does not prevent that. If we perform DROP OWNED BY on a role that is listed more than once, RemoveRoleFromObjectPolicy either suff

pgsql: Fix misbehavior of DROP OWNED BY with duplicate polroles entries

2021-06-18 Thread Tom Lane
Fix misbehavior of DROP OWNED BY with duplicate polroles entries. Ordinarily, a pg_policy.polroles array wouldn't list the same role more than once; but CREATE POLICY does not prevent that. If we perform DROP OWNED BY on a role that is listed more than once, RemoveRoleFromObjectPolicy either suff

pgsql: Fix misbehavior of DROP OWNED BY with duplicate polroles entries

2021-06-18 Thread Tom Lane
Fix misbehavior of DROP OWNED BY with duplicate polroles entries. Ordinarily, a pg_policy.polroles array wouldn't list the same role more than once; but CREATE POLICY does not prevent that. If we perform DROP OWNED BY on a role that is listed more than once, RemoveRoleFromObjectPolicy either suff

pgsql: Improve version reporting in pgbench.

2021-06-18 Thread Tom Lane
Improve version reporting in pgbench. Commit 547f04e73 caused pgbench to start printing its version number, which seems like a fine idea, but it needs a bit more work: * Print the server version number too, when different. * Print the PG_VERSION string, not some reconstructed approximation. This

Re: pgsql: s/table_close/heap_close/ in v11.

2021-06-18 Thread Andrew Dunstan
On 6/18/21 11:45 AM, Tom Lane wrote: > s/table_close/heap_close/ in v11. > > Back-patching thinko in 306c31804. Per buildfarm. > Oops. Thanks for fixing. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com

pgsql: Avoid scribbling on input node tree in CREATE/ALTER DOMAIN.

2021-06-18 Thread Tom Lane
Avoid scribbling on input node tree in CREATE/ALTER DOMAIN. This works fine in the "simple Query" code path; but if the statement is in the plan cache then it's corrupted for future re-execution. Apply copyObject() to protect the original tree from modification, as we've done elsewhere. This nar

pgsql: Avoid scribbling on input node tree in CREATE/ALTER DOMAIN.

2021-06-18 Thread Tom Lane
Avoid scribbling on input node tree in CREATE/ALTER DOMAIN. This works fine in the "simple Query" code path; but if the statement is in the plan cache then it's corrupted for future re-execution. Apply copyObject() to protect the original tree from modification, as we've done elsewhere. This nar

pgsql: Avoid scribbling on input node tree in CREATE/ALTER DOMAIN.

2021-06-18 Thread Tom Lane
Avoid scribbling on input node tree in CREATE/ALTER DOMAIN. This works fine in the "simple Query" code path; but if the statement is in the plan cache then it's corrupted for future re-execution. Apply copyObject() to protect the original tree from modification, as we've done elsewhere. This nar

pgsql: Avoid scribbling on input node tree in CREATE/ALTER DOMAIN.

2021-06-18 Thread Tom Lane
Avoid scribbling on input node tree in CREATE/ALTER DOMAIN. This works fine in the "simple Query" code path; but if the statement is in the plan cache then it's corrupted for future re-execution. Apply copyObject() to protect the original tree from modification, as we've done elsewhere. This nar

pgsql: Avoid scribbling on input node tree in CREATE/ALTER DOMAIN.

2021-06-18 Thread Tom Lane
Avoid scribbling on input node tree in CREATE/ALTER DOMAIN. This works fine in the "simple Query" code path; but if the statement is in the plan cache then it's corrupted for future re-execution. Apply copyObject() to protect the original tree from modification, as we've done elsewhere. This nar

pgsql: s/table_close/heap_close/ in v11.

2021-06-18 Thread Tom Lane
s/table_close/heap_close/ in v11. Back-patching thinko in 306c31804. Per buildfarm. Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/0d3b69ae000b1f968700f7797c236a45ce76b8d7 Modified Files -- src/backend/catalog/heap.c | 2 +- 1 file changed, 1 in

pgsql: Centralize the logic for protective copying of utility statement

2021-06-18 Thread Tom Lane
Centralize the logic for protective copying of utility statements. In the "simple Query" code path, it's fine for parse analysis or execution of a utility statement to scribble on the statement's node tree, since that'll just be thrown away afterwards. However it's not fine if the node tree is in

Re: pgsql: Don't set a fast default for anything but a plain table

2021-06-18 Thread Tom Lane
Andrew Dunstan writes: > Don't set a fast default for anything but a plain table Buildfarm's not happy with the v11 version. regards, tom lane

pgsql: Don't set a fast default for anything but a plain table

2021-06-18 Thread Andrew Dunstan
Don't set a fast default for anything but a plain table The fast default code added in Release 11 omitted to check that the table a fast default was being added to was a plain table. Thus one could be added to a foreign table, which predicably blows up. Here we perform that check. In addition, on

pgsql: Don't set a fast default for anything but a plain table

2021-06-18 Thread Andrew Dunstan
Don't set a fast default for anything but a plain table The fast default code added in Release 11 omitted to check that the table a fast default was being added to was a plain table. Thus one could be added to a foreign table, which predicably blows up. Here we perform that check. In addition, on

pgsql: Don't set a fast default for anything but a plain table

2021-06-18 Thread Andrew Dunstan
Don't set a fast default for anything but a plain table The fast default code added in Release 11 omitted to check that the table a fast default was being added to was a plain table. Thus one could be added to a foreign table, which predicably blows up. Here we perform that check. In addition, on

pgsql: Don't set a fast default for anything but a plain table

2021-06-18 Thread Andrew Dunstan
Don't set a fast default for anything but a plain table The fast default code added in Release 11 omitted to check that the table a fast default was being added to was a plain table. Thus one could be added to a foreign table, which predicably blows up. Here we perform that check. In addition, on

Re: pgsql: Make archiver process an auxiliary process.

2021-06-18 Thread Fujii Masao
On 2021/06/17 20:32, Thomas Munro wrote: On Thu, Jun 17, 2021 at 11:28 PM Fujii Masao wrote: Attached patch changes archiver so that it also handles barrier events. LGTM. Thanks! Pushed. Thanks! Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Head

pgsql: Make archiver process handle barrier events.

2021-06-18 Thread Fujii Masao
Make archiver process handle barrier events. Commit d75288fb27 made WAL archiver process an auxiliary process. An auxiliary process needs to handle barrier events but the commit forgot to make archiver process do that. Reported-by: Thomas Munro Author: Fujii Masao Reviewed-by: Thomas Munro Discus