Re: pgsql: psql: Add test for query canceling

2021-08-24 Thread Peter Eisentraut
On 23.08.21 13:12, Daniel Gustafsson wrote: 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

Re: pgsql: psql: Add test for query canceling

2021-08-24 Thread Daniel Gustafsson
> On 24 Aug 2021, at 15:40, Peter Eisentraut > wrote: > > On 23.08.21 13:12, Daniel Gustafsson wrote: >>> 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 SIGALR

Re: pgsql: psql: Add test for query canceling

2021-08-24 Thread Tom Lane
Daniel Gustafsson writes: >> On 24 Aug 2021, at 15:40, Peter Eisentraut >> wrote: >> Thanks for looking into this. With your patch applied, tests 2, 3, and 4 >> fail. Do they pass for you? > Thats odd, all tests pass for me. Did the logs give an indication as to what > was failing? I also

Re: pgsql: psql: Add test for query canceling

2021-08-24 Thread Peter Eisentraut
On 20.08.21 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 the psql run without an immediate wait for termination. That gets rid of the first problem (thoug

Re: pgsql: psql: Add test for query canceling

2021-08-24 Thread Tom Lane
Peter Eisentraut writes: > Here is a proposal. It waits separately for the pid file to appear and > also checks for the sleep query to be registered by the backend, so it > doesn't have any more dependencies on things happening "fast enough". > And it's also faster in the normal case now. Tho

Re: pgsql: psql: Add test for query canceling

2021-08-24 Thread Daniel Gustafsson
> On 24 Aug 2021, at 18:43, Peter Eisentraut > wrote: > > On 20.08.21 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 the psql run without an immedi

pgsql: Fix regexp misbehavior with capturing parens inside "{0}".

2021-08-24 Thread Tom Lane
Fix regexp misbehavior with capturing parens inside "{0}". Regexps like "(.){0}...\1" drew an "invalid backreference number". That's not unreasonable on its face, since the capture group will never be matched if it's iterated zero times. However, other engines such as Perl's don't complain about

pgsql: Fix regexp misbehavior with capturing parens inside "{0}".

2021-08-24 Thread Tom Lane
Fix regexp misbehavior with capturing parens inside "{0}". Regexps like "(.){0}...\1" drew an "invalid backreference number". That's not unreasonable on its face, since the capture group will never be matched if it's iterated zero times. However, other engines such as Perl's don't complain about

pgsql: Fix regexp misbehavior with capturing parens inside "{0}".

2021-08-24 Thread Tom Lane
Fix regexp misbehavior with capturing parens inside "{0}". Regexps like "(.){0}...\1" drew an "invalid backreference number". That's not unreasonable on its face, since the capture group will never be matched if it's iterated zero times. However, other engines such as Perl's don't complain about

pgsql: Fix regexp misbehavior with capturing parens inside "{0}".

2021-08-24 Thread Tom Lane
Fix regexp misbehavior with capturing parens inside "{0}". Regexps like "(.){0}...\1" drew an "invalid backreference number". That's not unreasonable on its face, since the capture group will never be matched if it's iterated zero times. However, other engines such as Perl's don't complain about

pgsql: Fix regexp misbehavior with capturing parens inside "{0}".

2021-08-24 Thread Tom Lane
Fix regexp misbehavior with capturing parens inside "{0}". Regexps like "(.){0}...\1" drew an "invalid backreference number". That's not unreasonable on its face, since the capture group will never be matched if it's iterated zero times. However, other engines such as Perl's don't complain about

pgsql: Fix regexp misbehavior with capturing parens inside "{0}".

2021-08-24 Thread Tom Lane
Fix regexp misbehavior with capturing parens inside "{0}". Regexps like "(.){0}...\1" drew an "invalid backreference number". That's not unreasonable on its face, since the capture group will never be matched if it's iterated zero times. However, other engines such as Perl's don't complain about

pgsql: Fix regexp misbehavior with capturing parens inside "{0}".

2021-08-24 Thread Tom Lane
Fix regexp misbehavior with capturing parens inside "{0}". Regexps like "(.){0}...\1" drew an "invalid backreference number". That's not unreasonable on its face, since the capture group will never be matched if it's iterated zero times. However, other engines such as Perl's don't complain about

pgsql: ecpg: Remove trailing period from error message.

2021-08-24 Thread Fujii Masao
ecpg: Remove trailing period from error message. This commit improves the ecpg's error message that commit f576de1db1 updated, so that it gets rid of trailing period and uppercases the command name in the error message. Author: Kyotaro Horiguchi Reviewed-by: Fujii Masao Discussion: https://post

pgsql: Avoid using ambiguous word "positive" in error message.

2021-08-24 Thread Fujii Masao
Avoid using ambiguous word "positive" in error message. There are two identical error messages about valid value of modulus for hash partition, in PostgreSQL source code. Commit 0e1275fb07 improved only one of them so that ambiguous word "positive" was avoided there, and forgot to improve the othe

pgsql: Improve error message about valid value for distance in phrase o

2021-08-24 Thread Fujii Masao
Improve error message about valid value for distance in phrase operator. The distance in phrase operator must be an integer value between zero and MAXENTRYPOS inclusive. But previously the error message about its valid value included the information about its upper limit but not lower limit (i.e.,

pgsql: Avoid using ambiguous word "positive" in error message.

2021-08-24 Thread Fujii Masao
Avoid using ambiguous word "positive" in error message. There are two identical error messages about valid value of modulus for hash partition, in PostgreSQL source code. Commit 0e1275fb07 improved only one of them so that ambiguous word "positive" was avoided there, and forgot to improve the othe

pgsql: Improve error message about valid value for distance in phrase o

2021-08-24 Thread Fujii Masao
Improve error message about valid value for distance in phrase operator. The distance in phrase operator must be an integer value between zero and MAXENTRYPOS inclusive. But previously the error message about its valid value included the information about its upper limit but not lower limit (i.e.,

pgsql: Avoid using ambiguous word "positive" in error message.

2021-08-24 Thread Fujii Masao
Avoid using ambiguous word "positive" in error message. There are two identical error messages about valid value of modulus for hash partition, in PostgreSQL source code. Commit 0e1275fb07 improved only one of them so that ambiguous word "positive" was avoided there, and forgot to improve the othe

pgsql: Improve error message about valid value for distance in phrase o

2021-08-24 Thread Fujii Masao
Improve error message about valid value for distance in phrase operator. The distance in phrase operator must be an integer value between zero and MAXENTRYPOS inclusive. But previously the error message about its valid value included the information about its upper limit but not lower limit (i.e.,

pgsql: Improve error message about valid value for distance in phrase o

2021-08-24 Thread Fujii Masao
Improve error message about valid value for distance in phrase operator. The distance in phrase operator must be an integer value between zero and MAXENTRYPOS inclusive. But previously the error message about its valid value included the information about its upper limit but not lower limit (i.e.,

pgsql: Avoid using ambiguous word "positive" in error message.

2021-08-24 Thread Fujii Masao
Avoid using ambiguous word "positive" in error message. There are two identical error messages about valid value of modulus for hash partition, in PostgreSQL source code. Commit 0e1275fb07 improved only one of them so that ambiguous word "positive" was avoided there, and forgot to improve the othe

pgsql: Improve error message about valid value for distance in phrase o

2021-08-24 Thread Fujii Masao
Improve error message about valid value for distance in phrase operator. The distance in phrase operator must be an integer value between zero and MAXENTRYPOS inclusive. But previously the error message about its valid value included the information about its upper limit but not lower limit (i.e.,

pgsql: Avoid using ambiguous word "positive" in error message.

2021-08-24 Thread Fujii Masao
Avoid using ambiguous word "positive" in error message. There are two identical error messages about valid value of modulus for hash partition, in PostgreSQL source code. Commit 0e1275fb07 improved only one of them so that ambiguous word "positive" was avoided there, and forgot to improve the othe

pgsql: Improve error message about valid value for distance in phrase o

2021-08-24 Thread Fujii Masao
Improve error message about valid value for distance in phrase operator. The distance in phrase operator must be an integer value between zero and MAXENTRYPOS inclusive. But previously the error message about its valid value included the information about its upper limit but not lower limit (i.e.,

pgsql: Improve error message about valid value for distance in phrase o

2021-08-24 Thread Fujii Masao
Improve error message about valid value for distance in phrase operator. The distance in phrase operator must be an integer value between zero and MAXENTRYPOS inclusive. But previously the error message about its valid value included the information about its upper limit but not lower limit (i.e.,

Re: pgsql: ecpg: Remove trailing period from error message.

2021-08-24 Thread Kyotaro Horiguchi
At Wed, 25 Aug 2021 00:57:25 +, Fujii Masao wrote in > ecpg: Remove trailing period from error message. > > This commit improves the ecpg's error message that commit f576de1db1 updated, > so that it gets rid of trailing period and uppercases the command name > in the error message. > > Aut

pgsql: Add tab completion for EXPLAIN .. EXECUTE in psql

2021-08-24 Thread Michael Paquier
Add tab completion for EXPLAIN .. EXECUTE in psql Author: Dagfinn Ilmari Mannsåker Discussion: https://posgr.es/m/871r75gd0i@wibble.ilmari.org Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/34651131348dfb60be124b3c1dfe92d09a94494f Modified Files --

pgsql: ecpg: Remove trailing period from error message.

2021-08-24 Thread Fujii Masao
ecpg: Remove trailing period from error message. This commit improves the ecpg's error message that commit f576de1db1 updated, so that it gets rid of trailing period and uppercases the command name in the error message. Back-patch to v14 where the error message exists. Author: Kyotaro Horiguchi

Re: pgsql: ecpg: Remove trailing period from error message.

2021-08-24 Thread Fujii Masao
On 2021/08/25 11:58, Kyotaro Horiguchi wrote: REL_14_STABLE has the same commit as e2d6da0708, (which I found at the first time). Thanks for pointing out this! So I did the backpatch to v14. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters

pgsql: Doc: Tweak function prototype indentation for consistency.

2021-08-24 Thread Etsuro Fujita
Doc: Tweak function prototype indentation for consistency. Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/22583edee7f4c6be6894b03c5cd93fd02e2a826a Modified Files -- doc/src/sgml/fdwhandler.sgml | 8 1 file changed, 4 insertions(+), 4 dele

pgsql: Doc: Tweak function prototype indentation for consistency.

2021-08-24 Thread Etsuro Fujita
Doc: Tweak function prototype indentation for consistency. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/255ed90fd260061b4261569151539068be262b51 Modified Files -- doc/src/sgml/fdwhandler.sgml | 8 1 file changed, 4 insertions(+), 4 deletions(-

pgsql: Fix toast rewrites in logical decoding.

2021-08-24 Thread Amit Kapila
Fix toast rewrites in logical decoding. Commit 325f2ec555 introduced pg_class.relwrite to skip operations on tables created as part of a heap rewrite during DDL. It links such transient heaps to the original relation OID via this new field in pg_class but forgot to do anything about toast tables.

pgsql: Fix toast rewrites in logical decoding.

2021-08-24 Thread Amit Kapila
Fix toast rewrites in logical decoding. Commit 325f2ec555 introduced pg_class.relwrite to skip operations on tables created as part of a heap rewrite during DDL. It links such transient heaps to the original relation OID via this new field in pg_class but forgot to do anything about toast tables.

pgsql: Fix toast rewrites in logical decoding.

2021-08-24 Thread Amit Kapila
Fix toast rewrites in logical decoding. Commit 325f2ec555 introduced pg_class.relwrite to skip operations on tables created as part of a heap rewrite during DDL. It links such transient heaps to the original relation OID via this new field in pg_class but forgot to do anything about toast tables.

pgsql: Fix toast rewrites in logical decoding.

2021-08-24 Thread Amit Kapila
Fix toast rewrites in logical decoding. Commit 325f2ec555 introduced pg_class.relwrite to skip operations on tables created as part of a heap rewrite during DDL. It links such transient heaps to the original relation OID via this new field in pg_class but forgot to do anything about toast tables.

pgsql: Fix toast rewrites in logical decoding.

2021-08-24 Thread Amit Kapila
Fix toast rewrites in logical decoding. Commit 325f2ec555 introduced pg_class.relwrite to skip operations on tables created as part of a heap rewrite during DDL. It links such transient heaps to the original relation OID via this new field in pg_class but forgot to do anything about toast tables.

Re: pgsql: psql: Add test for query canceling

2021-08-24 Thread Fabien COELHO
That looks pretty solid to me, and I can confirm that it passes on wrasse's host. The only nit I can find to pick is that this: + usleep(10_000) until -s "$tempdir/psql.pid" or ($count++ > 180 * 100 and die 'pid file did not appear'); basically assumes that psql.pid will be written ato

pgsql: Fix incorrect merge in ECPG code with DECLARE

2021-08-24 Thread Michael Paquier
Fix incorrect merge in ECPG code with DECLARE The same condition was repeated twice when comparing the connection used by existing declared statement with the one coming from a fresh DECLARE statement. This had no consequences, but let's keep the code clean. Oversight in f576de1. Author: Shenhao

pgsql: Fix incorrect merge in ECPG code with DECLARE

2021-08-24 Thread Michael Paquier
Fix incorrect merge in ECPG code with DECLARE The same condition was repeated twice when comparing the connection used by existing declared statement with the one coming from a fresh DECLARE statement. This had no consequences, but let's keep the code clean. Oversight in f576de1. Author: Shenhao