Re: pgsql: Improve scripting language in pgbench

2018-01-09 Thread Thomas Munro
On Wed, Jan 10, 2018 at 4:02 AM, Teodor Sigaev wrote: > Improve scripting language in pgbench Hi Teodor, I think this commit might have lost a fix from 0aa1d489ea756b96b6d5573692ae9cd5d143c2a5. bowerbird and jacana now fail when they see an unexpected "0" before the exponent: Jan 09 11:49:51 #

pgsql: Remove outdated/removed Win32 URLs in C comments

2018-01-09 Thread Bruce Momjian
Remove outdated/removed Win32 URLs in C comments Reported-by: Ashutosh Sharma Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/fccaea45496d721012ce8fbbebae82e4dbfc1ef4 Modified Files -- src/include/port/win32.h | 3 --- 1 file changed, 3 deletions(-)

pgsql: Expression evaluation based aggregate transition invocation.

2018-01-09 Thread Andres Freund
Expression evaluation based aggregate transition invocation. Previously aggregate transition and combination functions were invoked by special case code in nodeAgg.c, evaluating input and filters separately using the expression evaluation machinery. That turns out to not be great for performance f

pgsql: Change some bogus PageGetLSN calls to BufferGetLSNAtomic

2018-01-09 Thread Alvaro Herrera
Change some bogus PageGetLSN calls to BufferGetLSNAtomic As src/backend/access/transam/README says, PageGetLSN may only be called by processes holding either exclusive lock on buffer, or a shared lock on buffer plus buffer header lock. Therefore any place that only holds a shared buffer lock must

pgsql: Change some bogus PageGetLSN calls to BufferGetLSNAtomic

2018-01-09 Thread Alvaro Herrera
Change some bogus PageGetLSN calls to BufferGetLSNAtomic As src/backend/access/transam/README says, PageGetLSN may only be called by processes holding either exclusive lock on buffer, or a shared lock on buffer plus buffer header lock. Therefore any place that only holds a shared buffer lock must

pgsql: Change some bogus PageGetLSN calls to BufferGetLSNAtomic

2018-01-09 Thread Alvaro Herrera
Change some bogus PageGetLSN calls to BufferGetLSNAtomic As src/backend/access/transam/README says, PageGetLSN may only be called by processes holding either exclusive lock on buffer, or a shared lock on buffer plus buffer header lock. Therefore any place that only holds a shared buffer lock must

pgsql: Change some bogus PageGetLSN calls to BufferGetLSNAtomic

2018-01-09 Thread Alvaro Herrera
Change some bogus PageGetLSN calls to BufferGetLSNAtomic As src/backend/access/transam/README says, PageGetLSN may only be called by processes holding either exclusive lock on buffer, or a shared lock on buffer plus buffer header lock. Therefore any place that only holds a shared buffer lock must

pgsql: Change some bogus PageGetLSN calls to BufferGetLSNAtomic

2018-01-09 Thread Alvaro Herrera
Change some bogus PageGetLSN calls to BufferGetLSNAtomic As src/backend/access/transam/README says, PageGetLSN may only be called by processes holding either exclusive lock on buffer, or a shared lock on buffer plus buffer header lock. Therefore any place that only holds a shared buffer lock must

pgsql: Change some bogus PageGetLSN calls to BufferGetLSNAtomic

2018-01-09 Thread Alvaro Herrera
Change some bogus PageGetLSN calls to BufferGetLSNAtomic As src/backend/access/transam/README says, PageGetLSN may only be called by processes holding either exclusive lock on buffer, or a shared lock on buffer plus buffer header lock. Therefore any place that only holds a shared buffer lock must

pgsql: Implement TZH and TZM timestamp format patterns

2018-01-09 Thread Andrew Dunstan
Implement TZH and TZM timestamp format patterns These are compatible with Oracle and required for the datetime template language for jsonpath in an upcoming patch. Nikita Glukhov and Andrew Dunstan, reviewed by Pavel Stehule. Branch -- master Details --- https://git.postgresql.org/pg/co

pgsql: Remove PortalGetQueryDesc()

2018-01-09 Thread Peter Eisentraut
Remove PortalGetQueryDesc() After having gotten rid of PortalGetHeapMemory(), there seems little reason to keep one Portal access macro around that offers no actual abstraction and isn't consistently used anyway. Reviewed-by: Andrew Dunstan Reviewed-by: Alvaro Herrera Branch -- master Det

pgsql: Update portal-related memory context names and API

2018-01-09 Thread Peter Eisentraut
Update portal-related memory context names and API Rename PortalMemory to TopPortalContext, to avoid confusion with PortalContext and align naming with similar top-level memory contexts. Rename PortalData's "heap" field to portalContext. The "heap" naming seems quite antiquated and confusing. A

pgsql: Rewrite list_qsort() to avoid trashing its input list.

2018-01-09 Thread Tom Lane
Rewrite list_qsort() to avoid trashing its input list. The initial implementation of list_qsort(), from commit ab7271677, re-used the ListCells of the input list while not touching the List header. This meant that anybody who still had a pointer to the original header would now be in possession o

pgsql: Improve the heuristic for ordering child paths of a parallel app

2018-01-09 Thread Tom Lane
Improve the heuristic for ordering child paths of a parallel append. Commit ab7271677 introduced code that attempts to order the child scans of a Parallel Append node in a way that will minimize execution time, based on total cost and startup cost. However, it failed to think hard about what to d

pgsql: While waiting for a condition variable, detect postmaster death.

2018-01-09 Thread Tom Lane
While waiting for a condition variable, detect postmaster death. The general assumption for postmaster child processes is that they should just exit(1), reasonably promptly, if the postmaster disappears. condition_variable.c neglected this consideration and could be left waiting forever, if the co

pgsql: While waiting for a condition variable, detect postmaster death.

2018-01-09 Thread Tom Lane
While waiting for a condition variable, detect postmaster death. The general assumption for postmaster child processes is that they should just exit(1), reasonably promptly, if the postmaster disappears. condition_variable.c neglected this consideration and could be left waiting forever, if the co

pgsql: Fix ssl tests for when tls-server-end-point is not supported

2018-01-09 Thread Peter Eisentraut
Fix ssl tests for when tls-server-end-point is not supported Add a function to TestLib that allows us to check pg_config.h and then decide the expected test outcome based on that. Author: Michael Paquier Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c3d41ccf5931

pgsql: Fix race condition during replication origin drop.

2018-01-09 Thread Tom Lane
Fix race condition during replication origin drop. replorigin_drop() misunderstood the API for condition variables: it had ConditionVariablePrepareToSleep and ConditionVariableCancelSleep inside its test-and-sleep loop, rather than outside the loop as intended. The net effect is a narrow race-con

pgsql: Fix race condition during replication origin drop.

2018-01-09 Thread Tom Lane
Fix race condition during replication origin drop. replorigin_drop() misunderstood the API for condition variables: it had ConditionVariablePrepareToSleep and ConditionVariableCancelSleep inside its test-and-sleep loop, rather than outside the loop as intended. The net effect is a narrow race-con

pgsql: Allow ConditionVariable[PrepareTo]Sleep to auto-switch between C

2018-01-09 Thread Tom Lane
Allow ConditionVariable[PrepareTo]Sleep to auto-switch between CVs. The original coding here insisted that callers manually cancel any prepared sleep for one condition variable before starting a sleep on another one. While that's not a huge burden today, it seems like a gotcha that will bite us in

pgsql: Allow ConditionVariable[PrepareTo]Sleep to auto-switch between C

2018-01-09 Thread Tom Lane
Allow ConditionVariable[PrepareTo]Sleep to auto-switch between CVs. The original coding here insisted that callers manually cancel any prepared sleep for one condition variable before starting a sleep on another one. While that's not a huge burden today, it seems like a gotcha that will bite us in

pgsql: Don't allow VACUUM VERBOSE ANALYZE VERBOSE.

2018-01-09 Thread Robert Haas
Don't allow VACUUM VERBOSE ANALYZE VERBOSE. There are plans to extend the syntax for ANALYZE, so we need to break the link between VacuumStmt and AnalyzeStmt. But apart from that, the syntax above is undocumented and, if discovered by users, might give the impression that the VERBOSE option for V

pgsql: Improve scripting language in pgbench

2018-01-09 Thread Teodor Sigaev
Improve scripting language in pgbench Added: - variable now might contain integer, double, boolean and null values - functions ln, exp - logical AND/OR/NOT - bitwise AND/OR/NOT/XOR - bit right/left shift - comparison operators - IS [NOT] (NULL|TRUE|FALSE) - conditional choice (in form of w

pgsql: Fix comment.

2018-01-09 Thread Robert Haas
Fix comment. RELATION_IS_OTHER_TEMP is tested in the caller, not here. Discussion: http://postgr.es/m/5a5438e4.3090...@lab.ntt.co.jp Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/63008b19ee67270231694500832b031868d34428 Modified Files -- src/backend/