[COMMITTERS] pgsql: Rework DefineIndex relkind check

2017-10-16 Thread Alvaro Herrera
Rework DefineIndex relkind check Simplify coding using a switch rather than nested if tests. Author: Álvaro Reviewed-by: Robert Haas, Amit Langote, Michaël Paquier Discussion: https://postgr.es/m/20171013163820.pai7djcaxrntaxtn@alvherre.pgsql Branch -- master Details ---

[COMMITTERS] pgsql: Treat aggregate direct arguments as per-agg data not per-trans d

2017-10-16 Thread Tom Lane
Treat aggregate direct arguments as per-agg data not per-trans data. There is no reason to insist that direct arguments must match before we can merge transition states of two aggregate calls. They're only used during the finalfn call, so we can treat them as like the finalfn itself. This

[COMMITTERS] pgsql: Fix incorrect handling of CTEs and ENRs as DML target relations.

2017-10-16 Thread Tom Lane
Fix incorrect handling of CTEs and ENRs as DML target relations. setTargetTable threw an error if the proposed target RangeVar's relname matched any visible CTE or ENR. This breaks backwards compatibility in the CTE case, since pre-v10 we never looked for a CTE here at all, so that CTE names did

[COMMITTERS] pgsql: Repair breakage of aggregate FILTER option.

2017-10-16 Thread Tom Lane
Repair breakage of aggregate FILTER option. An aggregate's input expression(s) are not supposed to be evaluated at all for a row where its FILTER test fails ... but commit 8ed3f11bb overlooked that requirement. Reshuffle so that aggregates having a filter clause evaluate their arguments

[COMMITTERS] pgsql: Repair breakage of aggregate FILTER option.

2017-10-16 Thread Tom Lane
Repair breakage of aggregate FILTER option. An aggregate's input expression(s) are not supposed to be evaluated at all for a row where its FILTER test fails ... but commit 8ed3f11bb overlooked that requirement. Reshuffle so that aggregates having a filter clause evaluate their arguments

[COMMITTERS] pgsql: Allow the built-in ordered-set aggregates to share transition st

2017-10-16 Thread Tom Lane
Allow the built-in ordered-set aggregates to share transition state. The built-in OSAs all share the same transition function, so they can share transition state as long as the final functions cooperate to not do the sort step more than once. To avoid running the tuplesort object in randomAccess

[COMMITTERS] pgsql: Exclude flex-generated code from coverage testing

2017-10-16 Thread Peter Eisentraut
Exclude flex-generated code from coverage testing Flex generates a lot of functions that are not actually used. In order to avoid coverage figures being ruined by that, mark up the part of the .l files where the generated code appears by lcov exclusion markers. That way, lcov will typically only