pgsql: Improve wording about WAL files in tar mode of pg_basebackup

2019-01-29 Thread Magnus Hagander
Improve wording about WAL files in tar mode of pg_basebackup

Author: Alex Kliukin
Reviewed-By: Michael Paquier, Magnus Hagander

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/9745b528f7cb03be3afad0f91a634072c13ea91f

Modified Files
--
doc/src/sgml/ref/pg_basebackup.sgml | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)



pgsql: Improve wording about WAL files in tar mode of pg_basebackup

2019-01-29 Thread Magnus Hagander
Improve wording about WAL files in tar mode of pg_basebackup

Author: Alex Kliukin
Reviewed-By: Michael Paquier, Magnus Hagander

Branch
--
REL_11_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/ff9e63c7d33a92503895b3c8acc8d96cb8116220

Modified Files
--
doc/src/sgml/ref/pg_basebackup.sgml | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)



pgsql: Improve wording about WAL files in tar mode of pg_basebackup

2019-01-29 Thread Magnus Hagander
Improve wording about WAL files in tar mode of pg_basebackup

Author: Alex Kliukin
Reviewed-By: Michael Paquier, Magnus Hagander

Branch
--
REL_10_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/11b63452814ca011c271d484ee2be56b72f34d1f

Modified Files
--
doc/src/sgml/ref/pg_basebackup.sgml | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)



pgsql: Add tests for pg_stat_ssl system view

2019-01-29 Thread Peter Eisentraut
Add tests for pg_stat_ssl system view

Reviewed-by: Kyotaro HORIGUCHI 
Discussion: 
https://www.postgresql.org/message-id/flat/[email protected]/

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/18059543e76aeb6b3cf3a5513e69daf222d3558e

Modified Files
--
src/test/ssl/t/001_ssltests.pl | 22 +-
1 file changed, 21 insertions(+), 1 deletion(-)



pgsql: Fix pg_stat_ssl.clientdn

2019-01-29 Thread Peter Eisentraut
Fix pg_stat_ssl.clientdn

Return null if there is no client certificate.  This is how it has
always been documented, but in reality it returned an empty string.

Reviewed-by: Kyotaro HORIGUCHI 
Discussion: 
https://www.postgresql.org/message-id/flat/[email protected]/

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/e77cfa54d700557ea700d47454c9e570f20f1841

Modified Files
--
src/backend/utils/adt/pgstatfuncs.c | 5 -
src/test/ssl/t/001_ssltests.pl  | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)



pgsql: Make SSL tests more robust

2019-01-29 Thread Peter Eisentraut
Make SSL tests more robust

Someone running these test could have key or certificate files in
their ~/.postgresql/, which would interfere with the tests.  The way
to override that is to specify sslcert=invalid and/or
sslrootcert=invalid if no actual certificate is used for a particular
test.  Document that and fix up one test that had a risk of failing in
these circumstances.

Discussion: 
https://www.postgresql.org/message-id/flat/[email protected]/

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/bdd6e9ba171765ae34d320e1be17717620cb491c

Modified Files
--
src/test/ssl/ServerSetup.pm | 10 ++
src/test/ssl/t/002_scram.pl |  2 +-
2 files changed, 11 insertions(+), 1 deletion(-)



pgsql: Make some small planner API cleanups.

2019-01-29 Thread Tom Lane
Make some small planner API cleanups.

Move a few very simple node-creation and node-type-testing functions
from the planner's clauses.c to nodes/makefuncs and nodes/nodeFuncs.
There's nothing planner-specific about them, as evidenced by the
number of other places that were using them.

While at it, rename and_clause() etc to is_andclause() etc, to clarify
that they are node-type-testing functions not node-creation functions.
And use "static inline" implementations for the shortest ones.

Also, modify flatten_join_alias_vars() and some subsidiary functions
to take a Query not a PlannerInfo to define the join structure that
Vars should be translated according to.  They were only using the
"parse" field of the PlannerInfo anyway, so this just requires removing
one level of indirection.  The advantage is that now parse_agg.c can
use flatten_join_alias_vars() without the horrid kluge of creating an
incomplete PlannerInfo, which will allow that file to be decoupled from
relation.h in a subsequent patch.

Discussion: https://postgr.es/m/[email protected]

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/a1b8c41e990ec0f083e9b684700a07640d5a356a

Modified Files
--
src/backend/commands/explain.c |   1 +
src/backend/executor/nodeSubplan.c |   4 +-
src/backend/executor/nodeTidscan.c |   2 +-
src/backend/nodes/makefuncs.c  | 135 ++
src/backend/nodes/print.c  |   3 +-
src/backend/optimizer/path/clausesel.c |   7 +-
src/backend/optimizer/path/costsize.c  |   1 +
src/backend/optimizer/path/indxpath.c  |   6 +-
src/backend/optimizer/path/joinrels.c  |   4 +-
src/backend/optimizer/path/tidpath.c   |   2 +-
src/backend/optimizer/plan/initsplan.c |   1 +
src/backend/optimizer/plan/planner.c   |   5 +-
src/backend/optimizer/plan/subselect.c |  10 +-
src/backend/optimizer/prep/prepjointree.c  |  10 +-
src/backend/optimizer/prep/prepqual.c  |  15 +-
src/backend/optimizer/util/clauses.c   | 246 +
src/backend/optimizer/util/orclauses.c |   8 +-
src/backend/optimizer/util/predtest.c  |   5 +-
src/backend/optimizer/util/restrictinfo.c  |  10 +-
src/backend/optimizer/util/var.c   |  22 +--
src/backend/parser/parse_agg.c |  36 ++--
src/backend/partitioning/partprune.c   |   6 +-
src/backend/statistics/dependencies.c  |   3 +-
src/backend/utils/cache/relcache.c |   1 +
src/include/nodes/makefuncs.h  |  12 ++
src/include/nodes/nodeFuncs.h  |  72 
src/include/optimizer/clauses.h|  22 ---
src/include/optimizer/prep.h   |   2 +-
src/include/optimizer/var.h|   2 +-
src/test/modules/test_predtest/test_predtest.c |   1 +
30 files changed, 309 insertions(+), 345 deletions(-)



pgsql: Refactor planner's header files.

2019-01-29 Thread Tom Lane
Refactor planner's header files.

Create a new header optimizer/optimizer.h, which exposes just the
planner functions that can be used "at arm's length", without need
to access Paths or the other planner-internal data structures defined
in nodes/relation.h.  This is intended to provide the whole planner
API seen by most of the rest of the system; although FDWs still need
to use additional stuff, and more thought is also needed about just
what selfuncs.c should rely on.

The main point of doing this now is to limit the amount of new
#include baggage that will be needed by "planner support functions",
which I expect to introduce later, and which will be in relevant
datatype modules rather than anywhere near the planner.

This commit just moves relevant declarations into optimizer.h from
other header files (a couple of which go away because everything
got moved), and adjusts #include lists to match.  There's further
cleanup that could be done if we want to decide that some stuff
being exposed by optimizer.h doesn't belong in the planner at all,
but I'll leave that for another day.

Discussion: https://postgr.es/m/[email protected]

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/f09346a9c6218dd239fdf3a79a729716c0d305bd

Modified Files
--
contrib/bloom/blcost.c |   1 -
contrib/file_fdw/file_fdw.c|   3 +-
contrib/postgres_fdw/deparse.c |   3 +-
contrib/postgres_fdw/postgres_fdw.c|   2 +-
contrib/tsm_system_rows/tsm_system_rows.c  |   3 +-
contrib/tsm_system_time/tsm_system_time.c  |   3 +-
src/backend/access/gist/gistbuild.c|   2 +-
src/backend/access/spgist/spgutils.c   |   4 -
src/backend/access/tablesample/bernoulli.c |   3 +-
src/backend/access/tablesample/system.c|   3 +-
src/backend/access/transam/parallel.c  |   2 +-
src/backend/catalog/heap.c |   4 +-
src/backend/catalog/index.c|   3 +-
src/backend/catalog/partition.c|   4 +-
src/backend/commands/cluster.c |   2 +-
src/backend/commands/copy.c|   4 +-
src/backend/commands/explain.c |   2 -
src/backend/commands/functioncmds.c|   3 +-
src/backend/commands/indexcmds.c   |   4 +-
src/backend/commands/tablecmds.c   |   6 +-
src/backend/commands/trigger.c |   3 +-
src/backend/commands/typecmds.c|   2 +-
src/backend/executor/execExpr.c|   3 +-
src/backend/executor/execMain.c|   1 -
src/backend/executor/execParallel.c|   2 -
src/backend/executor/nodeAgg.c |   3 +-
src/backend/executor/nodeGather.c  |   2 +-
src/backend/executor/nodeGatherMerge.c |   2 +-
src/backend/executor/nodeIndexscan.c   |   1 -
src/backend/executor/nodeWindowAgg.c   |   2 +-
src/backend/jit/llvm/llvmjit_expr.c|   1 -
src/backend/optimizer/path/allpaths.c  |   2 +-
src/backend/optimizer/path/clausesel.c |   1 +
src/backend/optimizer/path/costsize.c  |   1 +
src/backend/optimizer/path/equivclass.c|   2 +-
src/backend/optimizer/path/indxpath.c  |   3 +-
src/backend/optimizer/path/pathkeys.c  |   3 +-
src/backend/optimizer/path/tidpath.c   |   2 +-
src/backend/optimizer/plan/analyzejoins.c  |   2 +-
src/backend/optimizer/plan/createplan.c|   3 +-
src/backend/optimizer/plan/initsplan.c |   2 +-
src/backend/optimizer/plan/planagg.c   |   1 +
src/backend/optimizer/plan/planmain.c  |   1 +
src/backend/optimizer/plan/planner.c   |   2 +-
src/backend/optimizer/plan/setrefs.c   |   1 +
src/backend/optimizer/plan/subselect.c |   2 +-
src/backend/optimizer/prep/prepjointree.c  |   2 +-
src/backend/optimizer/prep/prepqual.c  |   2 +-
src/backend/optimizer/prep/preptlist.c |   2 +-
src/backend/optimizer/util/clauses.c   |   2 +-
src/backend/optimizer/util/orclauses.c |   1 +
src/backend/optimizer/util/pathnode.c  |   2 +-
src/backend/optimizer/util/placeholder.c   |   2 +-
src/backend/optimizer/util/plancat.c   |   2 +-
src/backend/optimizer/util/predtest.c  |   4 +-
src/backend/optimizer/util/restrictinfo.c  |   2 +-
src/backend/optimizer/util/tlist.c |   1 +
src/backend/optimizer/util/var.c   |   2 +-
src/backend/parser/analyze.c   |   2 +-
src/backend/parser/parse_agg.c |   3 +-
src/backend/parser/parse_clause.c  |   3 +-
src/backend/parser/parse_expr.c|   3 +-
src/backend/parser/parse_utilcmd.c |   4 +-
src/backend/partitioning/partbounds.c  |   1 -
src/backend/partitioning/partprune.c   |   6 +-
src/backend/replication/logical/worker.c   |  27 +---
src/b

pgsql: Rename nodes/relation.h to nodes/pathnodes.h.

2019-01-29 Thread Tom Lane
Rename nodes/relation.h to nodes/pathnodes.h.

The old name of this file was never a very good indication of what it
was for.  Now that there's also access/relation.h, we have a potential
confusion hazard as well, so let's rename it to something more apropos.
Per discussion, "pathnodes.h" is reasonable, since a good fraction of
the file is Path node definitions.

While at it, tweak a couple of other headers that were gratuitously
importing relation.h into modules that don't need it.

Discussion: https://postgr.es/m/[email protected]

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/fa2cf164aaf91e074be653c28e035f65d80eb666

Modified Files
--
contrib/bloom/bloom.h |  2 +-
contrib/postgres_fdw/postgres_fdw.h   |  2 +-
src/backend/executor/execAmi.c|  3 ++-
src/backend/executor/nodeCustom.c |  1 +
src/backend/nodes/README  |  2 +-
src/backend/nodes/copyfuncs.c |  4 ++--
src/backend/nodes/equalfuncs.c|  4 ++--
src/backend/nodes/nodeFuncs.c |  2 +-
src/backend/nodes/outfuncs.c  |  4 ++--
src/backend/nodes/print.c |  2 +-
src/backend/optimizer/path/costsize.c |  4 ++--
src/backend/optimizer/util/predtest.c |  2 +-
src/backend/rewrite/rewriteManip.c|  2 +-
src/backend/statistics/dependencies.c |  2 +-
src/backend/statistics/extended_stats.c   |  1 -
src/include/access/tsmapi.h   |  2 +-
src/include/executor/executor.h   |  2 +-
src/include/executor/nodeCustom.h |  1 -
src/include/foreign/fdwapi.h  |  2 +-
src/include/nodes/extensible.h|  2 +-
src/include/nodes/nodes.h |  8 
src/include/nodes/{relation.h => pathnodes.h} | 12 ++--
src/include/optimizer/appendinfo.h|  2 +-
src/include/optimizer/clauses.h   |  2 +-
src/include/optimizer/cost.h  |  2 +-
src/include/optimizer/geqo.h  |  2 +-
src/include/optimizer/inherit.h   |  2 +-
src/include/optimizer/joininfo.h  |  2 +-
src/include/optimizer/optimizer.h |  4 ++--
src/include/optimizer/orclauses.h |  2 +-
src/include/optimizer/paramassign.h   |  2 +-
src/include/optimizer/pathnode.h  |  2 +-
src/include/optimizer/paths.h |  2 +-
src/include/optimizer/placeholder.h   |  2 +-
src/include/optimizer/plancat.h   |  2 +-
src/include/optimizer/planmain.h  |  2 +-
src/include/optimizer/planner.h   |  2 +-
src/include/optimizer/prep.h  |  2 +-
src/include/optimizer/restrictinfo.h  |  2 +-
src/include/optimizer/subselect.h |  2 +-
src/include/optimizer/tlist.h |  2 +-
src/include/partitioning/partprune.h  |  9 +
src/include/statistics/statistics.h   |  2 +-
src/include/utils/selfuncs.h  |  2 +-
44 files changed, 60 insertions(+), 59 deletions(-)



pgsql: Do not filter by relkind in vacuumdb's catalog query if --table

2019-01-29 Thread Michael Paquier
Do not filter by relkind in vacuumdb's catalog query if --table is used

If a user specifies a relation name which cannot be processed, then the
backend can warn directly about what is wrong with it.  This fixes an
oversight from e0c2933.

Author: Nathan Bossart
Discussion: https://postgr.es/m/[email protected]

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/b8f73df0f845d865823ef72669024dc150282392

Modified Files
--
src/bin/scripts/t/100_vacuumdb.pl |  9 -
src/bin/scripts/vacuumdb.c| 13 ++---
2 files changed, 18 insertions(+), 4 deletions(-)