[COMMITTERS] pgsql: Fix unexpected side-effects of operator_precedence_warning.

2016-04-21 Thread Tom Lane
Fix unexpected side-effects of operator_precedence_warning. The implementation of that feature involves injecting nodes into the raw parsetree where explicit parentheses appear. Various places in parse_expr.c that test to see "is this child node of type Foo" need to look through such nodes, else

[COMMITTERS] pgsql: Fix unexpected side-effects of operator_precedence_warning.

2016-04-21 Thread Tom Lane
Fix unexpected side-effects of operator_precedence_warning. The implementation of that feature involves injecting nodes into the raw parsetree where explicit parentheses appear. Various places in parse_expr.c that test to see "is this child node of type Foo" need to look through such nodes, else

[COMMITTERS] pgsql: Fix planner failure with full join in RHS of left join.

2016-04-21 Thread Tom Lane
Fix planner failure with full join in RHS of left join. Given a left join containing a full join in its righthand side, with the left join's joinclause referencing only one side of the full join (in a non-strict fashion, so that the full join doesn't get simplified), the planner could fail with "f

[COMMITTERS] pgsql: Fix planner failure with full join in RHS of left join.

2016-04-21 Thread Tom Lane
Fix planner failure with full join in RHS of left join. Given a left join containing a full join in its righthand side, with the left join's joinclause referencing only one side of the full join (in a non-strict fashion, so that the full join doesn't get simplified), the planner could fail with "f

[COMMITTERS] pgsql: Fix planner failure with full join in RHS of left join.

2016-04-21 Thread Tom Lane
Fix planner failure with full join in RHS of left join. Given a left join containing a full join in its righthand side, with the left join's joinclause referencing only one side of the full join (in a non-strict fashion, so that the full join doesn't get simplified), the planner could fail with "f

[COMMITTERS] pgsql: Fix planner failure with full join in RHS of left join.

2016-04-21 Thread Tom Lane
Fix planner failure with full join in RHS of left join. Given a left join containing a full join in its righthand side, with the left join's joinclause referencing only one side of the full join (in a non-strict fashion, so that the full join doesn't get simplified), the planner could fail with "f

[COMMITTERS] pgsql: Fix planner failure with full join in RHS of left join.

2016-04-21 Thread Tom Lane
Fix planner failure with full join in RHS of left join. Given a left join containing a full join in its righthand side, with the left join's joinclause referencing only one side of the full join (in a non-strict fashion, so that the full join doesn't get simplified), the planner could fail with "f

[COMMITTERS] pgsql: Fix planner failure with full join in RHS of left join.

2016-04-21 Thread Tom Lane
Fix planner failure with full join in RHS of left join. Given a left join containing a full join in its righthand side, with the left join's joinclause referencing only one side of the full join (in a non-strict fashion, so that the full join doesn't get simplified), the planner could fail with "f

Re: [HACKERS] Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold

2016-04-21 Thread Kevin Grittner
On Thu, Apr 21, 2016 at 2:10 PM, Ants Aasma wrote: > On Thu, Apr 21, 2016 at 5:16 PM, Kevin Grittner wrote: >> Could you provide enough to make that a self-contained >> reproducible test case [?] > [provided] Thanks! I have your test case running, and it is not immediately clear why old rows

[COMMITTERS] pgsql: Improve TranslateSocketError() to handle more Windows error code

2016-04-21 Thread Tom Lane
Improve TranslateSocketError() to handle more Windows error codes. The coverage was rather lean for cases that bind() or listen() might return. Add entries for everything that there's a direct equivalent for in the set of Unix errnos that elog.c has heard of. Branch -- master Details --

[COMMITTERS] pgsql: Remove dead code in win32.h.

2016-04-21 Thread Tom Lane
Remove dead code in win32.h. There's no longer a need for the MSVC-version-specific code stanza that forcibly redefines errno code symbols, because since commit 73838b52 we're unconditionally redefining them in the stanza before this one anyway. Now it's merely confusing and ugly, so get rid of it

[COMMITTERS] pgsql: Improve TranslateSocketError() to handle more Windows error code

2016-04-21 Thread Tom Lane
Improve TranslateSocketError() to handle more Windows error codes. The coverage was rather lean for cases that bind() or listen() might return. Add entries for everything that there's a direct equivalent for in the set of Unix errnos that elog.c has heard of. Branch -- REL9_1_STABLE Details

[COMMITTERS] pgsql: Remove dead code in win32.h.

2016-04-21 Thread Tom Lane
Remove dead code in win32.h. There's no longer a need for the MSVC-version-specific code stanza that forcibly redefines errno code symbols, because since commit 73838b52 we're unconditionally redefining them in the stanza before this one anyway. Now it's merely confusing and ugly, so get rid of it

[COMMITTERS] pgsql: Remove dead code in win32.h.

2016-04-21 Thread Tom Lane
Remove dead code in win32.h. There's no longer a need for the MSVC-version-specific code stanza that forcibly redefines errno code symbols, because since commit 73838b52 we're unconditionally redefining them in the stanza before this one anyway. Now it's merely confusing and ugly, so get rid of it

[COMMITTERS] pgsql: Improve TranslateSocketError() to handle more Windows error code

2016-04-21 Thread Tom Lane
Improve TranslateSocketError() to handle more Windows error codes. The coverage was rather lean for cases that bind() or listen() might return. Add entries for everything that there's a direct equivalent for in the set of Unix errnos that elog.c has heard of. Branch -- REL9_2_STABLE Details

[COMMITTERS] pgsql: Remove dead code in win32.h.

2016-04-21 Thread Tom Lane
Remove dead code in win32.h. There's no longer a need for the MSVC-version-specific code stanza that forcibly redefines errno code symbols, because since commit 73838b52 we're unconditionally redefining them in the stanza before this one anyway. Now it's merely confusing and ugly, so get rid of it

[COMMITTERS] pgsql: Remove dead code in win32.h.

2016-04-21 Thread Tom Lane
Remove dead code in win32.h. There's no longer a need for the MSVC-version-specific code stanza that forcibly redefines errno code symbols, because since commit 73838b52 we're unconditionally redefining them in the stanza before this one anyway. Now it's merely confusing and ugly, so get rid of it

[COMMITTERS] pgsql: Improve TranslateSocketError() to handle more Windows error code

2016-04-21 Thread Tom Lane
Improve TranslateSocketError() to handle more Windows error codes. The coverage was rather lean for cases that bind() or listen() might return. Add entries for everything that there's a direct equivalent for in the set of Unix errnos that elog.c has heard of. Branch -- REL9_3_STABLE Details

[COMMITTERS] pgsql: Improve TranslateSocketError() to handle more Windows error code

2016-04-21 Thread Tom Lane
Improve TranslateSocketError() to handle more Windows error codes. The coverage was rather lean for cases that bind() or listen() might return. Add entries for everything that there's a direct equivalent for in the set of Unix errnos that elog.c has heard of. Branch -- REL9_5_STABLE Details

[COMMITTERS] pgsql: Remove dead code in win32.h.

2016-04-21 Thread Tom Lane
Remove dead code in win32.h. There's no longer a need for the MSVC-version-specific code stanza that forcibly redefines errno code symbols, because since commit 73838b52 we're unconditionally redefining them in the stanza before this one anyway. Now it's merely confusing and ugly, so get rid of it

[COMMITTERS] pgsql: Improve TranslateSocketError() to handle more Windows error code

2016-04-21 Thread Tom Lane
Improve TranslateSocketError() to handle more Windows error codes. The coverage was rather lean for cases that bind() or listen() might return. Add entries for everything that there's a direct equivalent for in the set of Unix errnos that elog.c has heard of. Branch -- REL9_4_STABLE Details

[COMMITTERS] pgsql: Fix ruleutils.c's dumping of ScalarArrayOpExpr containing an EXP

2016-04-21 Thread Tom Lane
Fix ruleutils.c's dumping of ScalarArrayOpExpr containing an EXPR_SUBLINK. When we shoehorned "x op ANY (array)" into the SQL syntax, we created a fundamental ambiguity as to the proper treatment of a sub-SELECT on the righthand side: perhaps what's meant is to compare x against each row of the su

[COMMITTERS] pgsql: Fix ruleutils.c's dumping of ScalarArrayOpExpr containing an EXP

2016-04-21 Thread Tom Lane
Fix ruleutils.c's dumping of ScalarArrayOpExpr containing an EXPR_SUBLINK. When we shoehorned "x op ANY (array)" into the SQL syntax, we created a fundamental ambiguity as to the proper treatment of a sub-SELECT on the righthand side: perhaps what's meant is to compare x against each row of the su

[COMMITTERS] pgsql: Fix ruleutils.c's dumping of ScalarArrayOpExpr containing an EXP

2016-04-21 Thread Tom Lane
Fix ruleutils.c's dumping of ScalarArrayOpExpr containing an EXPR_SUBLINK. When we shoehorned "x op ANY (array)" into the SQL syntax, we created a fundamental ambiguity as to the proper treatment of a sub-SELECT on the righthand side: perhaps what's meant is to compare x against each row of the su

[COMMITTERS] pgsql: Fix ruleutils.c's dumping of ScalarArrayOpExpr containing an EXP

2016-04-21 Thread Tom Lane
Fix ruleutils.c's dumping of ScalarArrayOpExpr containing an EXPR_SUBLINK. When we shoehorned "x op ANY (array)" into the SQL syntax, we created a fundamental ambiguity as to the proper treatment of a sub-SELECT on the righthand side: perhaps what's meant is to compare x against each row of the su

[COMMITTERS] pgsql: Fix ruleutils.c's dumping of ScalarArrayOpExpr containing an EXP

2016-04-21 Thread Tom Lane
Fix ruleutils.c's dumping of ScalarArrayOpExpr containing an EXPR_SUBLINK. When we shoehorned "x op ANY (array)" into the SQL syntax, we created a fundamental ambiguity as to the proper treatment of a sub-SELECT on the righthand side: perhaps what's meant is to compare x against each row of the su

[COMMITTERS] pgsql: Fix ruleutils.c's dumping of ScalarArrayOpExpr containing an EXP

2016-04-21 Thread Tom Lane
Fix ruleutils.c's dumping of ScalarArrayOpExpr containing an EXPR_SUBLINK. When we shoehorned "x op ANY (array)" into the SQL syntax, we created a fundamental ambiguity as to the proper treatment of a sub-SELECT on the righthand side: perhaps what's meant is to compare x against each row of the su

[COMMITTERS] pgsql: Provide errno-translation wrappers around bind() and listen() on

2016-04-21 Thread Tom Lane
Provide errno-translation wrappers around bind() and listen() on Windows. Fix Windows builds to report something useful rather than "could not bind IPv4 socket: No error" when bind() fails. Back-patch of commits d1b7d4877b9a71f4 and 22989a8e34168f57. Discussion: <[email protected]>

[COMMITTERS] pgsql: Provide errno-translation wrappers around bind() and listen() on

2016-04-21 Thread Tom Lane
Provide errno-translation wrappers around bind() and listen() on Windows. Fix Windows builds to report something useful rather than "could not bind IPv4 socket: No error" when bind() fails. Back-patch of commits d1b7d4877b9a71f4 and 22989a8e34168f57. Discussion: <[email protected]>

[COMMITTERS] pgsql: Provide errno-translation wrappers around bind() and listen() on

2016-04-21 Thread Tom Lane
Provide errno-translation wrappers around bind() and listen() on Windows. Fix Windows builds to report something useful rather than "could not bind IPv4 socket: No error" when bind() fails. Back-patch of commits d1b7d4877b9a71f4 and 22989a8e34168f57. Discussion: <[email protected]>

[COMMITTERS] pgsql: Provide errno-translation wrappers around bind() and listen() on

2016-04-21 Thread Tom Lane
Provide errno-translation wrappers around bind() and listen() on Windows. Fix Windows builds to report something useful rather than "could not bind IPv4 socket: No error" when bind() fails. Back-patch of commits d1b7d4877b9a71f4 and 22989a8e34168f57. Discussion: <[email protected]>

[COMMITTERS] pgsql: Provide errno-translation wrappers around bind() and listen() on

2016-04-21 Thread Tom Lane
Provide errno-translation wrappers around bind() and listen() on Windows. Fix Windows builds to report something useful rather than "could not bind IPv4 socket: No error" when bind() fails. Back-patch of commits d1b7d4877b9a71f4 and 22989a8e34168f57. Discussion: <[email protected]>

Re: [HACKERS] Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold

2016-04-21 Thread Ants Aasma
On Thu, Apr 21, 2016 at 5:16 PM, Kevin Grittner wrote: > On Wed, Apr 20, 2016 at 8:08 PM, Ants Aasma wrote: > >> However, while checking out if my proof of concept patch actually >> works I hit another issue. I couldn't get my test for the feature to >> actually work. The test script I used is at

[COMMITTERS] pgsql: PGDLLIMPORT-ify old_snapshot_threshold.

2016-04-21 Thread Tom Lane
PGDLLIMPORT-ify old_snapshot_threshold. Revert commit 7cb1db1d9599f0a09d6920d2149d956ef6d88b0e, which represented a misunderstanding of the problem (if snapmgr.h weren't already included in bufmgr.h, things wouldn't compile anywhere). Instead install what I think is the real fix. Branch -- m

[COMMITTERS] pgsql: Prevent possible crash reading pg_stat_activity.

2016-04-21 Thread Robert Haas
Prevent possible crash reading pg_stat_activity. Also, avoid reading PGPROC's wait_event field twice, once for the wait event and again for the wait_event_type, because the value might change in the middle. Petr Jelinek and Robert Haas Branch -- master Details --- http://git.postgresql.

[COMMITTERS] pgsql: Comment improvements for ForeignPath.

2016-04-21 Thread Robert Haas
Comment improvements for ForeignPath. It's not necessarily just scanning a base relation any more. Amit Langote and Etsuro Fujita Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/36f69faeff540cd93de0b6aa7c2d2a7781d637a6 Modified Files -- src/backend/opti

[COMMITTERS] pgsql: Fix assorted defects in 09adc9a8c09c9640de05c7023b27fb83c761e91c

2016-04-21 Thread Robert Haas
Fix assorted defects in 09adc9a8c09c9640de05c7023b27fb83c761e91c. That commit increased all shared memory allocations to the next higher multiple of PG_CACHE_LINE_SIZE, but it didn't ensure that allocation started on a cache line boundary. It also failed to remove a couple other pieces of now-use

[COMMITTERS] pgsql: Include snapmgr.h in blscan.c

2016-04-21 Thread Kevin Grittner
Include snapmgr.h in blscan.c Windows builds on buildfarm are failing because old_snapshot_threshold is not found in the bloom filter contrib module. Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/7cb1db1d9599f0a09d6920d2149d956ef6d88b0e Modified Files

[COMMITTERS] pgsql: Allow queries submitted by postgres_fdw to be canceled.

2016-04-21 Thread Robert Haas
Allow queries submitted by postgres_fdw to be canceled. This fixes a problem which is not new, but with the advent of direct foreign table modification in 0bf3ae88af330496517722e391e7c975e6bad219, it's somewhat more likely to be annoying than previously. So, arrange for a local query cancelation

Re: [HACKERS] Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold

2016-04-21 Thread Kevin Grittner
On Wed, Apr 20, 2016 at 8:08 PM, Ants Aasma wrote: > However, while checking out if my proof of concept patch actually > works I hit another issue. I couldn't get my test for the feature to > actually work. The test script I used is attached. Could you provide enough to make that a self-containe

[COMMITTERS] pgsql: Inline initial comparisons in TestForOldSnapshot()

2016-04-21 Thread Kevin Grittner
Inline initial comparisons in TestForOldSnapshot() Even with old_snapshot_threshold = -1 (which disables the "snapshot too old" feature), performance regressions were seen at moderate to high concurrency. For example, a one-socket, four-core system running 200 connections at saturation could see