pgsql: Fix Alter Subscription's Add/Drop Publication behavior.

2021-08-23 Thread Amit Kapila
Fix Alter Subscription's Add/Drop Publication behavior. The current refresh behavior tries to just refresh added/dropped publications but that leads to removing wrong tables from subscription. We can't refresh just the dropped publication because it is quite possible that some of the tables are re

pgsql: Fix Alter Subscription's Add/Drop Publication behavior.

2021-08-23 Thread Amit Kapila
Fix Alter Subscription's Add/Drop Publication behavior. The current refresh behavior tries to just refresh added/dropped publications but that leads to removing wrong tables from subscription. We can't refresh just the dropped publication because it is quite possible that some of the tables are re

pgsql: Prevent regexp back-refs from sometimes matching when they shoul

2021-08-23 Thread Tom Lane
Prevent regexp back-refs from sometimes matching when they shouldn't. The recursion in cdissect() was careless about clearing match data for capturing parentheses after rejecting a partial match. This could allow a later back-reference to succeed when by rights it should fail for lack of a define

pgsql: Prevent regexp back-refs from sometimes matching when they shoul

2021-08-23 Thread Tom Lane
Prevent regexp back-refs from sometimes matching when they shouldn't. The recursion in cdissect() was careless about clearing match data for capturing parentheses after rejecting a partial match. This could allow a later back-reference to succeed when by rights it should fail for lack of a define

pgsql: Prevent regexp back-refs from sometimes matching when they shoul

2021-08-23 Thread Tom Lane
Prevent regexp back-refs from sometimes matching when they shouldn't. The recursion in cdissect() was careless about clearing match data for capturing parentheses after rejecting a partial match. This could allow a later back-reference to succeed when by rights it should fail for lack of a define

pgsql: Prevent regexp back-refs from sometimes matching when they shoul

2021-08-23 Thread Tom Lane
Prevent regexp back-refs from sometimes matching when they shouldn't. The recursion in cdissect() was careless about clearing match data for capturing parentheses after rejecting a partial match. This could allow a later back-reference to succeed when by rights it should fail for lack of a define

pgsql: Prevent regexp back-refs from sometimes matching when they shoul

2021-08-23 Thread Tom Lane
Prevent regexp back-refs from sometimes matching when they shouldn't. The recursion in cdissect() was careless about clearing match data for capturing parentheses after rejecting a partial match. This could allow a later back-reference to succeed when by rights it should fail for lack of a define

pgsql: Prevent regexp back-refs from sometimes matching when they shoul

2021-08-23 Thread Tom Lane
Prevent regexp back-refs from sometimes matching when they shouldn't. The recursion in cdissect() was careless about clearing match data for capturing parentheses after rejecting a partial match. This could allow a later back-reference to succeed when by rights it should fail for lack of a define

pgsql: Prevent regexp back-refs from sometimes matching when they shoul

2021-08-23 Thread Tom Lane
Prevent regexp back-refs from sometimes matching when they shouldn't. The recursion in cdissect() was careless about clearing match data for capturing parentheses after rejecting a partial match. This could allow a later back-reference to succeed when by rights it should fail for lack of a define

pgsql: Avoid creating archive status ".ready" files too early

2021-08-23 Thread Alvaro Herrera
Avoid creating archive status ".ready" files too early WAL records may span multiple segments, but XLogWrite() does not wait for the entire record to be written out to disk before creating archive status files. Instead, as soon as the last WAL page of the segment is written, the archive status fi

pgsql: Avoid creating archive status ".ready" files too early

2021-08-23 Thread Alvaro Herrera
Avoid creating archive status ".ready" files too early WAL records may span multiple segments, but XLogWrite() does not wait for the entire record to be written out to disk before creating archive status files. Instead, as soon as the last WAL page of the segment is written, the archive status fi

pgsql: Avoid creating archive status ".ready" files too early

2021-08-23 Thread Alvaro Herrera
Avoid creating archive status ".ready" files too early WAL records may span multiple segments, but XLogWrite() does not wait for the entire record to be written out to disk before creating archive status files. Instead, as soon as the last WAL page of the segment is written, the archive status fi

pgsql: Avoid creating archive status ".ready" files too early

2021-08-23 Thread Alvaro Herrera
Avoid creating archive status ".ready" files too early WAL records may span multiple segments, but XLogWrite() does not wait for the entire record to be written out to disk before creating archive status files. Instead, as soon as the last WAL page of the segment is written, the archive status fi

pgsql: Avoid creating archive status ".ready" files too early

2021-08-23 Thread Alvaro Herrera
Avoid creating archive status ".ready" files too early WAL records may span multiple segments, but XLogWrite() does not wait for the entire record to be written out to disk before creating archive status files. Instead, as soon as the last WAL page of the segment is written, the archive status fi

pgsql: Avoid creating archive status ".ready" files too early

2021-08-23 Thread Alvaro Herrera
Avoid creating archive status ".ready" files too early WAL records may span multiple segments, but XLogWrite() does not wait for the entire record to be written out to disk before creating archive status files. Instead, as soon as the last WAL page of the segment is written, the archive status fi

pgsql: Avoid creating archive status ".ready" files too early

2021-08-23 Thread Alvaro Herrera
Avoid creating archive status ".ready" files too early WAL records may span multiple segments, but XLogWrite() does not wait for the entire record to be written out to disk before creating archive status files. Instead, as soon as the last WAL page of the segment is written, the archive status fi

pgsql: Improve defaults shown in postgresql.conf.sample and pg_settings

2021-08-23 Thread Bruce Momjian
Improve defaults shown in postgresql.conf.sample and pg_settings Previously, these showed unlikely default values. The new default value 128MB (since PG 10) is not always accurate since initdb tries several increasing values, but it likely to be accurate. Reported-by: Zhangjie Discussion: htt

Re: pgsql: psql: Add test for query canceling

2021-08-23 Thread Daniel Gustafsson
> On 21 Aug 2021, at 00:40, Tom Lane wrote: > > Daniel Gustafsson writes: >> On 20 Aug 2021, at 20:47, Tom Lane wrote: >>> I think you should drop the overly-cute bit with a SIGALRM handler, >>> and instead have a loop-with-delay around an attempt to read the >>> psql.pid file, after launching