pgsql: Acquire properly session-level lock on new index in REINDEX CONC

2019-10-22 Thread Michael Paquier
Acquire properly session-level lock on new index in REINDEX CONCURRENTLY In the first transaction run for REINDEX CONCURRENTLY, a thinko in the existing logic caused two session locks to be taken on the old index, causing the session lock on the newly-created index to be missed. This made possibl

pgsql: Acquire properly session-level lock on new index in REINDEX CONC

2019-10-22 Thread Michael Paquier
Acquire properly session-level lock on new index in REINDEX CONCURRENTLY In the first transaction run for REINDEX CONCURRENTLY, a thinko in the existing logic caused two session locks to be taken on the old index, causing the session lock on the newly-created index to be missed. This made possibl

pgsql: Remove libpq-dist.rc

2019-10-22 Thread Peter Eisentraut
Remove libpq-dist.rc The use of this was removed by 6da56f3f84d430671d5edd8f9336bd744c089e31. Discussion: https://www.postgresql.org/message-id/87d95052-3780-b833-9953-27eab80186cf%402ndquadrant.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/508e84d79910cdb3b

pgsql: Remove last traces of --adduser/--no-adduser in createuser

2019-10-22 Thread Michael Paquier
Remove last traces of --adduser/--no-adduser in createuser 8ae0d47 marked those options as obsolete back in 2005, with the options removed from the documentation. This removes the last references to both options in the code which were kept around for compatibility purposes with past commands. Au

Re: pgsql: Fix parsing of integer values for connection parameters in libpq

2019-10-22 Thread Michael Paquier
On Tue, Oct 22, 2019 at 07:05:53PM +0900, Michael Paquier wrote: > Yes, it looks like a brain fade here. Conversion failures are tracked > before that, so strtol() would not return NULL for endptr. The first > part could just be removed as per the attached. I looked at that with a fresher mind,

pgsql: Fix thinkos from 4f4061b for libpq integer parsing

2019-10-22 Thread Michael Paquier
Fix thinkos from 4f4061b for libpq integer parsing A check was redundant. While on it, add an assertion to make sure that the parsing routine is never called with a NULL input. All the code paths currently calling the parsing routine are careful with NULL inputs already, but future callers may f

pgsql: Fix thinkos from 4f4061b for libpq integer parsing

2019-10-22 Thread Michael Paquier
Fix thinkos from 4f4061b for libpq integer parsing A check was redundant. While on it, add an assertion to make sure that the parsing routine is never called with a NULL input. All the code paths currently calling the parsing routine are careful with NULL inputs already, but future callers may f

pgsql: Clean up properly error_context_stack in autovacuum worker on ex

2019-10-22 Thread Michael Paquier
Clean up properly error_context_stack in autovacuum worker on exception Any callback set would have no meaning in the context of an exception. As an autovacuum worker exits quickly in this context, this could be only an issue within EmitErrorReport(), where the elog hook is for example called. Th

pgsql: Clean up properly error_context_stack in autovacuum worker on ex

2019-10-22 Thread Michael Paquier
Clean up properly error_context_stack in autovacuum worker on exception Any callback set would have no meaning in the context of an exception. As an autovacuum worker exits quickly in this context, this could be only an issue within EmitErrorReport(), where the elog hook is for example called. Th

pgsql: Clean up properly error_context_stack in autovacuum worker on ex

2019-10-22 Thread Michael Paquier
Clean up properly error_context_stack in autovacuum worker on exception Any callback set would have no meaning in the context of an exception. As an autovacuum worker exits quickly in this context, this could be only an issue within EmitErrorReport(), where the elog hook is for example called. Th

pgsql: Clean up properly error_context_stack in autovacuum worker on ex

2019-10-22 Thread Michael Paquier
Clean up properly error_context_stack in autovacuum worker on exception Any callback set would have no meaning in the context of an exception. As an autovacuum worker exits quickly in this context, this could be only an issue within EmitErrorReport(), where the elog hook is for example called. Th

pgsql: Clean up properly error_context_stack in autovacuum worker on ex

2019-10-22 Thread Michael Paquier
Clean up properly error_context_stack in autovacuum worker on exception Any callback set would have no meaning in the context of an exception. As an autovacuum worker exits quickly in this context, this could be only an issue within EmitErrorReport(), where the elog hook is for example called. Th

pgsql: Clean up properly error_context_stack in autovacuum worker on ex

2019-10-22 Thread Michael Paquier
Clean up properly error_context_stack in autovacuum worker on exception Any callback set would have no meaning in the context of an exception. As an autovacuum worker exits quickly in this context, this could be only an issue within EmitErrorReport(), where the elog hook is for example called. Th

pgsql: Clean up properly error_context_stack in autovacuum worker on ex

2019-10-22 Thread Michael Paquier
Clean up properly error_context_stack in autovacuum worker on exception Any callback set would have no meaning in the context of an exception. As an autovacuum worker exits quickly in this context, this could be only an issue within EmitErrorReport(), where the elog hook is for example called. Th

Re: pgsql: Fix parsing of integer values for connection parameters in libpq

2019-10-22 Thread Michael Paquier
On Tue, Oct 22, 2019 at 10:05:45AM +0200, Peter Eisentraut wrote: > You probably want something like > > if (end && *end != ...) Yes, it looks like a brain fade here. Conversion failures are tracked before that, so strtol() would not return NULL for endptr. The first part could just be remo

pgsql: Make command order in test more sensible

2019-10-22 Thread Peter Eisentraut
Make command order in test more sensible Through several updates, the CREATE USER command has been separated from where the user is actually used in the test. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/ad4b7aeb84434c958e2df76fa69b68493a889e4a Modified Files --

pgsql: Fix comment

2019-10-22 Thread Peter Eisentraut
Fix comment The last argument of smgrextend() was renamed from isTemp to skipFsync in debcec7dc31a992703911a9953e299c8d730c778, but the comments at two call sites were not updated. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/f86f46d091a6876fbf28e0a4a87ca72b560cf

Re: pgsql: Fix parsing of integer values for connection parameters in libpq

2019-10-22 Thread Peter Eisentraut
On 2019-10-21 04:18, Michael Paquier wrote: > Fix parsing of integer values for connection parameters in libpq Something in this code doesn't make sense: + /* +* Skip any trailing whitespace; if anything but whitespace remains before +* the terminating character, fail +*/ + while