pgsql: Improve tab-completion for CLOSE, DECLARE, FETCH and MOVE.

2021-01-13 Thread Fujii Masao
Improve tab-completion for CLOSE, DECLARE, FETCH and MOVE. This commit makes CLOSE, FETCH and MOVE commands tab-complete the list of cursors. Also this commit makes DECLARE command tab-complete the options. Author: Shinya Kato, Sawada Masahiko, tweaked by Fujii Masao Reviewed-by: Shinya Kato, Saw

Re: pgsql: Ensure that a standby is able to follow a primary on a newer tim

2021-01-13 Thread Fujii Masao
On 2021/01/14 14:23, Tom Lane wrote: Fujii Masao writes: On 2021/01/14 13:59, Michael Paquier wrote: florican is telling that this test has some stability problems: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=florican&dt=2021-01-14%2003%3A55%3A45 My guess is that the requested

pgsql: Minor header cleanup for the new iovec code.

2021-01-13 Thread Thomas Munro
Minor header cleanup for the new iovec code. Remove redundant function declaration and improve header comment in pg_iovec.h. Move the new declaration in fd.h next to a group of more similar functions. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/fb29ab26b38f1647

Re: pgsql: Ensure that a standby is able to follow a primary on a newer tim

2021-01-13 Thread Tom Lane
Fujii Masao writes: > On 2021/01/14 13:59, Michael Paquier wrote: >> florican is telling that this test has some stability problems: >> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=florican&dt=2021-01-14%2003%3A55%3A45 > My guess is that the requested WAL file was removed unfortunately

Re: pgsql: Ensure that a standby is able to follow a primary on a newer tim

2021-01-13 Thread Fujii Masao
On 2021/01/14 13:59, Michael Paquier wrote: Hi Fujii-san, On Thu, Jan 14, 2021 at 03:32:52AM +, Fujii Masao wrote: Ensure that a standby is able to follow a primary on a newer timeline. Commit 709d003fbd refactored WAL-reading code, but accidentally caused WalSndSegmentOpen() to fail to

Re: pgsql: Ensure that a standby is able to follow a primary on a newer tim

2021-01-13 Thread Michael Paquier
Hi Fujii-san, On Thu, Jan 14, 2021 at 03:32:52AM +, Fujii Masao wrote: > Ensure that a standby is able to follow a primary on a newer timeline. > > Commit 709d003fbd refactored WAL-reading code, but accidentally caused > WalSndSegmentOpen() to fail to follow a timeline switch while reading fr

pgsql: Ensure that a standby is able to follow a primary on a newer tim

2021-01-13 Thread Fujii Masao
Ensure that a standby is able to follow a primary on a newer timeline. Commit 709d003fbd refactored WAL-reading code, but accidentally caused WalSndSegmentOpen() to fail to follow a timeline switch while reading from a historic timeline. This issue caused a standby to fail to follow a primary on a

pgsql: Ensure that a standby is able to follow a primary on a newer tim

2021-01-13 Thread Fujii Masao
Ensure that a standby is able to follow a primary on a newer timeline. Commit 709d003fbd refactored WAL-reading code, but accidentally caused WalSndSegmentOpen() to fail to follow a timeline switch while reading from a historic timeline. This issue caused a standby to fail to follow a primary on a

pgsql: Rework refactoring of hex and encoding routines

2021-01-13 Thread Michael Paquier
Rework refactoring of hex and encoding routines This commit addresses some issues with c3826f83 that moved the hex decoding routine to src/common/: - The decoding function lacked overflow checks, so when used for security-related features it was an open door to out-of-bound writes if not carefully

pgsql: Move our p{read,write}v replacements into their own files.

2021-01-13 Thread Thomas Munro
Move our p{read,write}v replacements into their own files. macOS's ranlib issued a warning about an empty pread.o file with the previous arrangement, on systems new enough to require no replacement functions. Let's go back to using configure's AC_REPLACE_FUNCS system to build and include each .o

pgsql: Mark inet_server_addr() and inet_server_port() as parallel-restr

2021-01-13 Thread Tom Lane
Mark inet_server_addr() and inet_server_port() as parallel-restricted. These need to be PR because they access the MyProcPort data structure, which doesn't get copied to parallel workers. The very similar functions inet_client_addr() and inet_client_port() are already marked PR, but somebody miss

pgsql: Run reformat-dat-files to declutter the catalog data files.

2021-01-13 Thread Tom Lane
Run reformat-dat-files to declutter the catalog data files. Things had gotten pretty messy here, apparently mostly but not entirely the fault of the multirange patch. No functional changes. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/8b411b8ff41566a1aa601d1f05a

pgsql: Doc, more or less: uncomment tutorial example that was fixed lon

2021-01-13 Thread Tom Lane
Doc, more or less: uncomment tutorial example that was fixed long ago. Reverts a portion of commit 344190b7e. Apparently, back in the twentieth century we had some issues with multi-statement SQL functions, but they've worked fine for a long time. Daniel Westermann Discussion: https://postgr.e

pgsql: Call out vacuum considerations in create index docs

2021-01-13 Thread Alvaro Herrera
Call out vacuum considerations in create index docs Backpatch to pg12, which is as far as it goes without conflicts. Author: James Coleman Reviewed-by: "David G. Johnston" Discussion: https://postgr.es/m/caaaqye9oefbz7axxq7ox+ffvi5w5p1e_of8on8znko9qqbf...@mail.gmail.com Branch -- master

pgsql: Call out vacuum considerations in create index docs

2021-01-13 Thread Alvaro Herrera
Call out vacuum considerations in create index docs Backpatch to pg12, which is as far as it goes without conflicts. Author: James Coleman Reviewed-by: "David G. Johnston" Discussion: https://postgr.es/m/caaaqye9oefbz7axxq7ox+ffvi5w5p1e_of8on8znko9qqbf...@mail.gmail.com Branch -- REL_12_S

pgsql: Call out vacuum considerations in create index docs

2021-01-13 Thread Alvaro Herrera
Call out vacuum considerations in create index docs Backpatch to pg12, which is as far as it goes without conflicts. Author: James Coleman Reviewed-by: "David G. Johnston" Discussion: https://postgr.es/m/caaaqye9oefbz7axxq7ox+ffvi5w5p1e_of8on8znko9qqbf...@mail.gmail.com Branch -- REL_13_S

pgsql: Disallow a digit as the first character of a variable name in pg

2021-01-13 Thread Tom Lane
Disallow a digit as the first character of a variable name in pgbench. The point of this restriction is to avoid trying to substitute variables into timestamp literal values, which may contain strings like '12:34'. There is a good deal more that should be done to reduce pgbench's tendency to subs

pgsql: Disallow a digit as the first character of a variable name in pg

2021-01-13 Thread Tom Lane
Disallow a digit as the first character of a variable name in pgbench. The point of this restriction is to avoid trying to substitute variables into timestamp literal values, which may contain strings like '12:34'. There is a good deal more that should be done to reduce pgbench's tendency to subs

pgsql: Disallow a digit as the first character of a variable name in pg

2021-01-13 Thread Tom Lane
Disallow a digit as the first character of a variable name in pgbench. The point of this restriction is to avoid trying to substitute variables into timestamp literal values, which may contain strings like '12:34'. There is a good deal more that should be done to reduce pgbench's tendency to subs

pgsql: Disallow a digit as the first character of a variable name in pg

2021-01-13 Thread Tom Lane
Disallow a digit as the first character of a variable name in pgbench. The point of this restriction is to avoid trying to substitute variables into timestamp literal values, which may contain strings like '12:34'. There is a good deal more that should be done to reduce pgbench's tendency to subs

pgsql: Fix test failure with wal_level=minimal.

2021-01-13 Thread Heikki Linnakangas
Fix test failure with wal_level=minimal. The newly-added gist pageinspect test prints the LSNs of GiST pages, expecting them all to be 1 (GistBuildLSN). But with wal_level=minimal, they got updated by the whole-relation WAL-logging at commit. Fix by wrapping the problematic tests in the same trans

pgsql: Doc: clarify behavior of back-half options in pg_dump.

2021-01-13 Thread Tom Lane
Doc: clarify behavior of back-half options in pg_dump. Options that change how the archive data is converted to SQL text are ignored when dumping to archive formats. The documentation previously said "not meaningful", which is not helpful. Discussion: https://postgr.es/m/161052021249.12228.9598

pgsql: Doc: clarify behavior of back-half options in pg_dump.

2021-01-13 Thread Tom Lane
Doc: clarify behavior of back-half options in pg_dump. Options that change how the archive data is converted to SQL text are ignored when dumping to archive formats. The documentation previously said "not meaningful", which is not helpful. Discussion: https://postgr.es/m/161052021249.12228.9598

pgsql: Doc: clarify behavior of back-half options in pg_dump.

2021-01-13 Thread Tom Lane
Doc: clarify behavior of back-half options in pg_dump. Options that change how the archive data is converted to SQL text are ignored when dumping to archive formats. The documentation previously said "not meaningful", which is not helpful. Discussion: https://postgr.es/m/161052021249.12228.9598

pgsql: Doc: clarify behavior of back-half options in pg_dump.

2021-01-13 Thread Tom Lane
Doc: clarify behavior of back-half options in pg_dump. Options that change how the archive data is converted to SQL text are ignored when dumping to archive formats. The documentation previously said "not meaningful", which is not helpful. Discussion: https://postgr.es/m/161052021249.12228.9598

pgsql: Doc: clarify behavior of back-half options in pg_dump.

2021-01-13 Thread Tom Lane
Doc: clarify behavior of back-half options in pg_dump. Options that change how the archive data is converted to SQL text are ignored when dumping to archive formats. The documentation previously said "not meaningful", which is not helpful. Discussion: https://postgr.es/m/161052021249.12228.9598

pgsql: Doc: clarify behavior of back-half options in pg_dump.

2021-01-13 Thread Tom Lane
Doc: clarify behavior of back-half options in pg_dump. Options that change how the archive data is converted to SQL text are ignored when dumping to archive formats. The documentation previously said "not meaningful", which is not helpful. Discussion: https://postgr.es/m/161052021249.12228.9598

pgsql: Doc: clarify behavior of back-half options in pg_dump.

2021-01-13 Thread Tom Lane
Doc: clarify behavior of back-half options in pg_dump. Options that change how the archive data is converted to SQL text are ignored when dumping to archive formats. The documentation previously said "not meaningful", which is not helpful. Discussion: https://postgr.es/m/161052021249.12228.9598

pgsql: Enhance nbtree index tuple deletion.

2021-01-13 Thread Peter Geoghegan
Enhance nbtree index tuple deletion. Teach nbtree and heapam to cooperate in order to eagerly remove duplicate tuples representing dead MVCC versions. This is "bottom-up deletion". Each bottom-up deletion pass is triggered lazily in response to a flood of versions on an nbtree leaf page. This u

pgsql: Pass down "logically unchanged index" hint.

2021-01-13 Thread Peter Geoghegan
Pass down "logically unchanged index" hint. Add an executor aminsert() hint mechanism that informs index AMs that the incoming index tuple (the tuple that accompanies the hint) is not being inserted by execution of an SQL statement that logically modifies any of the index's key columns. The hint

pgsql: Log long wait time on recovery conflict when it's resolved.

2021-01-13 Thread Fujii Masao
Log long wait time on recovery conflict when it's resolved. This is a follow-up of the work done in commit 0650ff2303. This commit extends log_recovery_conflict_waits so that a log message is produced also when recovery conflict has already been resolved after deadlock_timeout passes, i.e., when t

pgsql: Fix portability issues in the new gist pageinspect test.

2021-01-13 Thread Heikki Linnakangas
Fix portability issues in the new gist pageinspect test. 1. The raw bytea representation of the point-type keys used in the test depends on endianess. Remove the raw key_data column from the test. 2. The items stored on non-leftmost gist page depends on how many items git on the other pages

pgsql: Remove incorrect markup

2021-01-13 Thread Magnus Hagander
Remove incorrect markup Seems 737d69ffc3c made a copy/paste or automation error resulting in two extra right-parenthesis. Reported-By: Michael Vastola Backpatch-through: 13 Discussion: https://postgr.es/m/[email protected] Branch -- REL_13_STABLE

pgsql: Remove incorrect markup

2021-01-13 Thread Magnus Hagander
Remove incorrect markup Seems 737d69ffc3c made a copy/paste or automation error resulting in two extra right-parenthesis. Reported-By: Michael Vastola Backpatch-through: 13 Discussion: https://postgr.es/m/[email protected] Branch -- master Detai

pgsql: Add functions to 'pageinspect' to inspect GiST indexes.

2021-01-13 Thread Heikki Linnakangas
Add functions to 'pageinspect' to inspect GiST indexes. Author: Andrey Borodin and me Discussion: https://www.postgresql.org/message-id/3E4F9093-A1B5-4DF8-A292-0B48692E3954%40yandex-team.ru Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/756ab29124d7850d4392e2227b6