pgsql: Fix comment in xlog.c.

2020-03-16 Thread Fujii Masao
Fix comment in xlog.c. This commit fixes the comment about SharedHotStandbyActive variable. The comment was apparently copy-and-pasted. Author: Atsushi Torikoshi Discussion: https://postgr.es/m/cacz0uyejpqzb9wn2rwc_rmvdybyyqdbkpudr1nyxjg4f9yg...@mail.gmail.com Branch -- master Details

pgsql: Remove useless pfree()s at the ends of various ValuePerCall SRFs

2020-03-16 Thread Tom Lane
Remove useless pfree()s at the ends of various ValuePerCall SRFs. We don't need to manually clean up allocations in a SRF's multi_call_memory_ctx, because the SRF_RETURN_DONE infrastructure takes care of that (and also ensures that it will happen even if the function never gets a final call, which

pgsql: Avoid holding a directory FD open across assorted SRF calls.

2020-03-16 Thread Tom Lane
Avoid holding a directory FD open across assorted SRF calls. This extends the fixes made in commit 085b6b667 to other SRFs with the same bug, namely pg_logdir_ls(), pgrowlocks(), pg_timezone_names(), pg_ls_dir(), and pg_tablespace_databases(). Also adjust various comments and documentation to war

pgsql: Avoid holding a directory FD open across assorted SRF calls.

2020-03-16 Thread Tom Lane
Avoid holding a directory FD open across assorted SRF calls. This extends the fixes made in commit 085b6b667 to other SRFs with the same bug, namely pg_logdir_ls(), pgrowlocks(), pg_timezone_names(), pg_ls_dir(), and pg_tablespace_databases(). Also adjust various comments and documentation to war

pgsql: Avoid holding a directory FD open across assorted SRF calls.

2020-03-16 Thread Tom Lane
Avoid holding a directory FD open across assorted SRF calls. This extends the fixes made in commit 085b6b667 to other SRFs with the same bug, namely pg_logdir_ls(), pgrowlocks(), pg_timezone_names(), pg_ls_dir(), and pg_tablespace_databases(). Also adjust various comments and documentation to war

pgsql: Avoid holding a directory FD open across assorted SRF calls.

2020-03-16 Thread Tom Lane
Avoid holding a directory FD open across assorted SRF calls. This extends the fixes made in commit 085b6b667 to other SRFs with the same bug, namely pg_logdir_ls(), pgrowlocks(), pg_timezone_names(), pg_ls_dir(), and pg_tablespace_databases(). Also adjust various comments and documentation to war

pgsql: Avoid holding a directory FD open across assorted SRF calls.

2020-03-16 Thread Tom Lane
Avoid holding a directory FD open across assorted SRF calls. This extends the fixes made in commit 085b6b667 to other SRFs with the same bug, namely pg_logdir_ls(), pgrowlocks(), pg_timezone_names(), pg_ls_dir(), and pg_tablespace_databases(). Also adjust various comments and documentation to war

pgsql: Avoid holding a directory FD open across assorted SRF calls.

2020-03-16 Thread Tom Lane
Avoid holding a directory FD open across assorted SRF calls. This extends the fixes made in commit 085b6b667 to other SRFs with the same bug, namely pg_logdir_ls(), pgrowlocks(), pg_timezone_names(), pg_ls_dir(), and pg_tablespace_databases(). Also adjust various comments and documentation to war

pgsql: nbtree: Fix obsolete _bt_search() comment.

2020-03-16 Thread Peter Geoghegan
nbtree: Fix obsolete _bt_search() comment. Oversight in commit d2086b08b02. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/113758155c11cf993ca0ecee8856e300a2525a30 Modified Files -- src/backend/access/nbtree/nbtsearch.c | 4 ++-- 1 file changed, 2 inser

pgsql: Document pg_ls_*dir hiding of directories and special files

2020-03-16 Thread Alvaro Herrera
Document pg_ls_*dir hiding of directories and special files It's strange that a directory-listing function does not list all entries in a directory, so let's at least document it. This involves pg_ls_logdir pg_ls_waldir pg_ls_archive_statusdir pg_ls_tmpdir Backpatch as far back as it applies cl

pgsql: Document pg_ls_*dir hiding of directories and special files

2020-03-16 Thread Alvaro Herrera
Document pg_ls_*dir hiding of directories and special files It's strange that a directory-listing function does not list all entries in a directory, so let's at least document it. This involves pg_ls_logdir pg_ls_waldir pg_ls_archive_statusdir pg_ls_tmpdir Backpatch as far back as it applies cl

pgsql: Document pg_ls_*dir hiding of directories and special files

2020-03-16 Thread Alvaro Herrera
Document pg_ls_*dir hiding of directories and special files It's strange that a directory-listing function does not list all entries in a directory, so let's at least document it. This involves pg_ls_logdir pg_ls_waldir pg_ls_archive_statusdir pg_ls_tmpdir Backpatch as far back as it applies cl

pgsql: Update comment

2020-03-16 Thread Alvaro Herrera
Update comment I forgot to update it per last-minute edits leading to commit 2f9661311b83. Reported by Mark Dilger. Discussion: https://postgr.es/m/[email protected]> Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b234b567ed74

Re: pgsql: Add kqueue(2) support to the WaitEventSet API.

2020-03-16 Thread Thomas Munro
On Tue, Mar 17, 2020 at 9:30 AM Alvaro Herrera wrote: > On 2020-Mar-17, Thomas Munro wrote: > > Reproduced here. The problem seems to be that macOS's getppid() > > returns the debugger's PID, while the debugger is attached. This > > doesn't happen on FreeBSD (even though the debugger does intern

Re: pgsql: Add kqueue(2) support to the WaitEventSet API.

2020-03-16 Thread Alvaro Herrera
On 2020-Mar-17, Thomas Munro wrote: > Reproduced here. The problem seems to be that macOS's getppid() > returns the debugger's PID, while the debugger is attached. This > doesn't happen on FreeBSD (even though the debugger does internally > become the parent, getppid() is careful to return the "

Re: pgsql: Add kqueue(2) support to the WaitEventSet API.

2020-03-16 Thread Thomas Munro
On Tue, Mar 17, 2020 at 12:55 AM Alexander Korotkov wrote: > On Wed, Feb 5, 2020 at 7:59 AM Thomas Munro wrote: > > Add kqueue(2) support to the WaitEventSet API. > > > > Use kevent(2) to wait for events on the BSD family of operating > > systems and macOS. This is similar to the epoll(2) suppor

pgsql: Plug memory leak

2020-03-16 Thread Alvaro Herrera
Plug memory leak Introduced by b08dee24a557. Noted by Coverity. Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/cf72898c686ce81fd870769f1a51818b49688bec Modified Files -- src/bin/pg_dump/pg_dump.c | 1 + 1 file changed, 1 insertion(+)

pgsql: Plug memory leak

2020-03-16 Thread Alvaro Herrera
Plug memory leak Introduced by b08dee24a557. Noted by Coverity. Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/c6b75b3f14fd4ff973ad3d2e2cfe42b5639bd101 Modified Files -- src/bin/pg_dump/pg_dump.c | 1 + 1 file changed, 1 insertion(+)

pgsql: Plug memory leak

2020-03-16 Thread Alvaro Herrera
Plug memory leak Introduced by b08dee24a557. Noted by Coverity. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/046001fe3cf59e19b2e8c24b82fb2e9b8ab6edd4 Modified Files -- src/bin/pg_dump/pg_dump.c | 1 + 1 file changed, 1 insertion(+)

pgsql: Plug memory leak

2020-03-16 Thread Alvaro Herrera
Plug memory leak Introduced by b08dee24a557. Noted by Coverity. Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/55978e28cd50e7db02289e1dca93a9284c7c2b05 Modified Files -- src/bin/pg_dump/pg_dump.c | 1 + 1 file changed, 1 insertion(+)

pgsql: Plug memory leak

2020-03-16 Thread Alvaro Herrera
Plug memory leak Introduced by b08dee24a557. Noted by Coverity. Branch -- REL9_6_STABLE Details --- https://git.postgresql.org/pg/commitdiff/7984c7e9fcd9468007c3ac51ba65f9642ba4dc4b Modified Files -- src/bin/pg_dump/pg_dump.c | 1 + 1 file changed, 1 insertion(+)

pgsql: nbtree: Pass down MAXALIGN()'d itemsz for new item.

2020-03-16 Thread Peter Geoghegan
nbtree: Pass down MAXALIGN()'d itemsz for new item. Refactor nbtinsert.c so that the final itemsz of each new non-pivot tuple (the MAXALIGN()'d size) is determined once. Most of the functions used by leaf page inserts used the insertstate.itemsz value already. This commit makes everything use ins

Re: pgsql: Add kqueue(2) support to the WaitEventSet API.

2020-03-16 Thread Alexander Korotkov
On Wed, Feb 5, 2020 at 7:59 AM Thomas Munro wrote: > Add kqueue(2) support to the WaitEventSet API. > > Use kevent(2) to wait for events on the BSD family of operating > systems and macOS. This is similar to the epoll(2) support added > for Linux by commit 98a64d0bd. I'm not sure if it was alrea