pgsql: Make pg_restore's identify_locking_dependencies() more bulletpro

2018-08-28 Thread Tom Lane
Make pg_restore's identify_locking_dependencies() more bulletproof. This function had a blacklist of dump object types that it believed needed exclusive lock ... but we hadn't maintained that, so that it was missing ROW SECURITY, POLICY, and INDEX ATTACH items, all of which need (or should be trea

pgsql: Make pg_restore's identify_locking_dependencies() more bulletpro

2018-08-28 Thread Tom Lane
Make pg_restore's identify_locking_dependencies() more bulletproof. This function had a blacklist of dump object types that it believed needed exclusive lock ... but we hadn't maintained that, so that it was missing ROW SECURITY, POLICY, and INDEX ATTACH items, all of which need (or should be trea

pgsql: Code review for pg_dump's handling of ALTER INDEX ATTACH PARTITI

2018-08-28 Thread Tom Lane
Code review for pg_dump's handling of ALTER INDEX ATTACH PARTITION. Ensure the TOC entry is marked with the correct schema, so that its name is as unique as the index's is. Fix the dependencies: we want dependencies from this TOC entry to the two indexes it depends on, and we don't care (at least

pgsql: Make pg_restore's identify_locking_dependencies() more bulletpro

2018-08-28 Thread Tom Lane
Make pg_restore's identify_locking_dependencies() more bulletproof. This function had a blacklist of dump object types that it believed needed exclusive lock ... but we hadn't maintained that, so that it was missing ROW SECURITY, POLICY, and INDEX ATTACH items, all of which need (or should be trea

pgsql: Make pg_restore's identify_locking_dependencies() more bulletpro

2018-08-28 Thread Tom Lane
Make pg_restore's identify_locking_dependencies() more bulletproof. This function had a blacklist of dump object types that it believed needed exclusive lock ... but we hadn't maintained that, so that it was missing ROW SECURITY, POLICY, and INDEX ATTACH items, all of which need (or should be trea

pgsql: Code review for pg_dump's handling of ALTER INDEX ATTACH PARTITI

2018-08-28 Thread Tom Lane
Code review for pg_dump's handling of ALTER INDEX ATTACH PARTITION. Ensure the TOC entry is marked with the correct schema, so that its name is as unique as the index's is. Fix the dependencies: we want dependencies from this TOC entry to the two indexes it depends on, and we don't care (at least

pgsql: Make pg_restore's identify_locking_dependencies() more bulletpro

2018-08-28 Thread Tom Lane
Make pg_restore's identify_locking_dependencies() more bulletproof. This function had a blacklist of dump object types that it believed needed exclusive lock ... but we hadn't maintained that, so that it was missing ROW SECURITY, POLICY, and INDEX ATTACH items, all of which need (or should be trea

Re: pgsql: Rework option set of vacuumlo

2018-08-28 Thread Tom Lane
Michael Paquier writes: > On Tue, Aug 28, 2018 at 05:08:25PM -0400, Tom Lane wrote: >> Oh! The reason why not is that that line is inside "ifdef REGRESS", >> and these subdirectories have no REGRESS tests. So we should move >> that out to where it will apply regardless of that. Will fix. > Yes

Re: pgsql: Rework option set of vacuumlo

2018-08-28 Thread Michael Paquier
On Tue, Aug 28, 2018 at 05:08:25PM -0400, Tom Lane wrote: > I wrote: >> Digging, this is because the "make check" processing isn't actually >> installing oid2name (resp. vacuumlo) into the temp installation tree :-(. >> >> I don't think this is the fault of your tests, exactly --- there's >> somet

pgsql: Include contrib modules in the temp installation even without RE

2018-08-28 Thread Tom Lane
Include contrib modules in the temp installation even without REGRESS. Now that we have TAP tests, a contrib module may have something useful to do in "make check" even if it has no pg_regress-style regression scripts, and hence no REGRESS setting. But the TAP tests will fail, or else test the wr

pgsql: Include contrib modules in the temp installation even without RE

2018-08-28 Thread Tom Lane
Include contrib modules in the temp installation even without REGRESS. Now that we have TAP tests, a contrib module may have something useful to do in "make check" even if it has no pg_regress-style regression scripts, and hence no REGRESS setting. But the TAP tests will fail, or else test the wr

Re: pgsql: Rework option set of vacuumlo

2018-08-28 Thread Tom Lane
I wrote: > Digging, this is because the "make check" processing isn't actually > installing oid2name (resp. vacuumlo) into the temp installation tree :-(. > > I don't think this is the fault of your tests, exactly --- there's > something wrong in the existing make rules. I'm not sure what though.

Re: pgsql: Rework option set of vacuumlo

2018-08-28 Thread Tom Lane
Michael Paquier writes: > Documentation and code is reordered to be more consistent. A basic set > of TAP tests has been added while on it. It'd be even better if these tests passed. For me, not so much: $ make check ... t/001_basic.pl .. # Looks like your test exited with 2 before it could out

pgsql: postgres_fdw: don't push ORDER BY with no vars (bug #15352)

2018-08-28 Thread Andrew Gierth
postgres_fdw: don't push ORDER BY with no vars (bug #15352) Commit aa09cd242 changed a condition in find_em_expr_for_rel from being a bms_equal comparison of relids to bms_is_subset, in order to support order by clauses on foreign joins. But this also allows through the degenerate case of expressi

pgsql: postgres_fdw: don't push ORDER BY with no vars (bug #15352)

2018-08-28 Thread Andrew Gierth
postgres_fdw: don't push ORDER BY with no vars (bug #15352) Commit aa09cd242 changed a condition in find_em_expr_for_rel from being a bms_equal comparison of relids to bms_is_subset, in order to support order by clauses on foreign joins. But this also allows through the degenerate case of expressi

pgsql: postgres_fdw: don't push ORDER BY with no vars (bug #15352)

2018-08-28 Thread Andrew Gierth
postgres_fdw: don't push ORDER BY with no vars (bug #15352) Commit aa09cd242 changed a condition in find_em_expr_for_rel from being a bms_equal comparison of relids to bms_is_subset, in order to support order by clauses on foreign joins. But this also allows through the degenerate case of expressi

pgsql: postgres_fdw: don't push ORDER BY with no vars (bug #15352)

2018-08-28 Thread Andrew Gierth
postgres_fdw: don't push ORDER BY with no vars (bug #15352) Commit aa09cd242 changed a condition in find_em_expr_for_rel from being a bms_equal comparison of relids to bms_is_subset, in order to support order by clauses on foreign joins. But this also allows through the degenerate case of expressi

pgsql: Rework option set of vacuumlo

2018-08-28 Thread Michael Paquier
Rework option set of vacuumlo Like oid2name, vacuumlo has been lacking consistency with other utilities for its options: - Connection options gain long aliases. - Document environment variables which could be used: PGHOST, PGPORT and PGUSER. Documentation and code is reordered to be more consiste

pgsql: Rework option set of oid2name

2018-08-28 Thread Michael Paquier
Rework option set of oid2name oid2name has done little effort to keep an interface consistent with other binary utilities: - -H was used instead of -h/-host. This option is now marked as deprecated, still its output is accepted to be backward-compatible. - -P has been removed from the code, and w

pgsql: Avoid quadratic slowdown in regexp match/split functions.

2018-08-28 Thread Andrew Gierth
Avoid quadratic slowdown in regexp match/split functions. regexp_matches, regexp_split_to_table and regexp_split_to_array all work by compiling a list of match positions as character offsets (NOT byte positions) in the source string. Formerly, they then used text_substr to extract the matched tex

pgsql: Avoid quadratic slowdown in regexp match/split functions.

2018-08-28 Thread Andrew Gierth
Avoid quadratic slowdown in regexp match/split functions. regexp_matches, regexp_split_to_table and regexp_split_to_array all work by compiling a list of match positions as character offsets (NOT byte positions) in the source string. Formerly, they then used text_substr to extract the matched tex

pgsql: Avoid quadratic slowdown in regexp match/split functions.

2018-08-28 Thread Andrew Gierth
Avoid quadratic slowdown in regexp match/split functions. regexp_matches, regexp_split_to_table and regexp_split_to_array all work by compiling a list of match positions as character offsets (NOT byte positions) in the source string. Formerly, they then used text_substr to extract the matched tex

pgsql: Avoid quadratic slowdown in regexp match/split functions.

2018-08-28 Thread Andrew Gierth
Avoid quadratic slowdown in regexp match/split functions. regexp_matches, regexp_split_to_table and regexp_split_to_array all work by compiling a list of match positions as character offsets (NOT byte positions) in the source string. Formerly, they then used text_substr to extract the matched tex

pgsql: Avoid quadratic slowdown in regexp match/split functions.

2018-08-28 Thread Andrew Gierth
Avoid quadratic slowdown in regexp match/split functions. regexp_matches, regexp_split_to_table and regexp_split_to_array all work by compiling a list of match positions as character offsets (NOT byte positions) in the source string. Formerly, they then used text_substr to extract the matched tex

pgsql: Avoid quadratic slowdown in regexp match/split functions.

2018-08-28 Thread Andrew Gierth
Avoid quadratic slowdown in regexp match/split functions. regexp_matches, regexp_split_to_table and regexp_split_to_array all work by compiling a list of match positions as character offsets (NOT byte positions) in the source string. Formerly, they then used text_substr to extract the matched tex

pgsql: Avoid quadratic slowdown in regexp match/split functions.

2018-08-28 Thread Andrew Gierth
Avoid quadratic slowdown in regexp match/split functions. regexp_matches, regexp_split_to_table and regexp_split_to_array all work by compiling a list of match positions as character offsets (NOT byte positions) in the source string. Formerly, they then used text_substr to extract the matched tex

pgsql: pg_verify_checksums: Message style improvements and NLS support

2018-08-28 Thread Peter Eisentraut
pg_verify_checksums: Message style improvements and NLS support The source code was already set up for NLS support, so just a nls.mk file needed to be added. Also, fix the old problem of putting the int64 format specifier right into the string, which breaks NLS. Branch -- REL_11_STABLE Deta

pgsql: pg_verify_checksums: Message style improvements and NLS support

2018-08-28 Thread Peter Eisentraut
pg_verify_checksums: Message style improvements and NLS support The source code was already set up for NLS support, so just a nls.mk file needed to be added. Also, fix the old problem of putting the int64 format specifier right into the string, which breaks NLS. Branch -- master Details ---