[COMMITTERS] pgsql: Fix grammar

2017-03-07 Thread Magnus Hagander
Fix grammar

Reported by Jeremy Finzel

Branch
--
REL9_6_STABLE

Details
---
http://git.postgresql.org/pg/commitdiff/c6117eecec4281432f240028bc9ab3c4ad253efe

Modified Files
--
doc/src/sgml/wal.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Fix grammar

2017-03-07 Thread Magnus Hagander
Fix grammar

Reported by Jeremy Finzel

Branch
--
REL9_5_STABLE

Details
---
http://git.postgresql.org/pg/commitdiff/68392a2af7f0b590859aad6205d1734aae3a2690

Modified Files
--
doc/src/sgml/wal.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Fix grammar

2017-03-07 Thread Magnus Hagander
Fix grammar

Reported by Jeremy Finzel

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/b7fa016d68b51bc385b75f9d5cffef79e5671981

Modified Files
--
doc/src/sgml/wal.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Fix segfault in ALTER PUBLICATION/SUBSCRIPTION RENAME

2017-03-07 Thread Peter Eisentraut
Fix segfault in ALTER PUBLICATION/SUBSCRIPTION RENAME

From: Masahiko Sawada 
Reported-by: Fujii Masao 

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/b8957927e642ae15c01f985c17fd6fe00ec68069

Modified Files
--
src/backend/catalog/objectaddress.c| 4 ++--
src/test/regress/expected/publication.out  | 7 +++
src/test/regress/expected/subscription.out | 7 +++
src/test/regress/sql/publication.sql   | 7 +++
src/test/regress/sql/subscription.sql  | 7 +++
5 files changed, 30 insertions(+), 2 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Re: [COMMITTERS] pgsql: Suppress compiler warnings in ecpg test on newer Windows toolcha

2017-03-07 Thread David Rowley
On 25 February 2017 at 10:45, Tom Lane  wrote:
> Suppress compiler warnings in ecpg test on newer Windows toolchains.
>
> nan_test.pgc supposed that it could unconditionally #define isnan()
> and isinf() on WIN32.  This was evidently copied at some point from
> src/include/port/win32.h, but nowadays there's a test on _MSC_VER
> there.  Make nan_test.pgc look the same.
>
> Per buildfarm warnings.  There's no evidence this produces anything
> worse than a warning, and besides it's only a test case, so I don't
> feel a need to back-patch.
>
> Branch
> --
> master
>
> Details
> ---
> http://git.postgresql.org/pg/commitdiff/c5658a0764d5ac5ea8c2c11d27c62d5472234227
>
> Modified Files
> --
> .../ecpg/test/expected/pgtypeslib-nan_test.c   | 102 +++---
> .../ecpg/test/expected/pgtypeslib-nan_test.stderr  | 354 ++---
> src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc   |   2 +
> 3 files changed, 231 insertions(+), 227 deletions(-)

This seems to have caused some new compiler warnings [1] on earlier
MSVC toolchains.

The reason seems to be that these older versions require float.h to be
included for _isnan() [2]

So anyway, we seem to be including float.h in all the other places
we're using isnan(), so the attached adds float.h to the files where
we're getting the warnings too.

[1] 
https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=thrips=2017-03-07%2022%3A37%3A28=make
[2] https://msdn.microsoft.com/en-us/library/tzthab44(v=vs.110).aspx

-- 
 David Rowley   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


isnan_msvc_warning_fixes.patch
Description: Binary data

-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: hash: Refactor hash index creation.

2017-03-07 Thread Robert Haas
hash: Refactor hash index creation.

The primary goal here is to move all of the related page modifications
to a single section of code, in preparation for adding write-ahead
logging.  In passing, rename _hash_metapinit to _hash_init, since it
initializes more than just the metapage.

Amit Kapila.  The larger patch series of which this is a part has been
reviewed and tested by Álvaro Herrera, Ashutosh Sharma, Mark Kirkwood,
Jeff Janes, and Jesper Pedersen.

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/38305398cdc029e3a74bfad1815cb33f5b087336

Modified Files
--
src/backend/access/hash/hash.c |   4 +-
src/backend/access/hash/hashovfl.c |  62 ---
src/backend/access/hash/hashpage.c | 203 +
src/include/access/hash.h  |  10 +-
4 files changed, 144 insertions(+), 135 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Improve postgresql.conf.sample comments about parallel workers.

2017-03-07 Thread Robert Haas
Improve postgresql.conf.sample comments about parallel workers.

David Rowley, reviewed by Amit Kapila

Discussion: 
http://postgr.es/m/cakjs1f8gpeupscj6ksqpvemnnx9_3zypzwskstv+8atx6vm...@mail.gmail.com

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/2b87dd8d7ae33ef5c70671674c08bbff066738bf

Modified Files
--
src/backend/utils/misc/postgresql.conf.sample | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Properly initialize variable.

2017-03-07 Thread Robert Haas
Properly initialize variable.

Commit 3bc7dafa9bebbdaa1bbf0da0798d29a8bdaf6a8f forgot to do this.

Noted while experimenting with valgrind.

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/506f05423a7c60eef8ed8b5430d03be1fec138a2

Modified Files
--
src/backend/optimizer/path/joinpath.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Re: [COMMITTERS] pgsql: Fix pgbench's failure to honor the documented long-form option "

2017-03-07 Thread Fabien COELHO



Not only did it not accept --builtin as a synonym for -b, but what it did
accept as a synonym was --tpc-b (huh?), which it got even further wrong
by marking as no_argument, so that if you did try that you got a core
dump.  I suppose this is leftover from some early design for the new
switches added by commit 8bea3d221, but it's still pretty sloppy work.


Argh, shame on me. I think at some point --tpc-b was an alias for the 
default script which then got replaced by builtin + name, but the 
implementation did not follow the upgrade:-( Sorry for the result.


--
Fabien.


--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Invent start_proc parameters for PL/Tcl.

2017-03-07 Thread Tom Lane
Invent start_proc parameters for PL/Tcl.

Define GUCs pltcl.start_proc and pltclu.start_proc.  When set to a
nonempty value at the time a new Tcl interpreter is created, the
parameterless pltcl or pltclu function named by the GUC is called to
allow user-controlled initialization to occur within the interpreter.
This is modeled on plv8's start_proc parameter, and also has much in
common with plperl's on_init feature.  It allows users to fully
replace the "modules" feature that was removed in commit 817f2a586.

Since an initializer function could subvert later Tcl code in nearly
arbitrary ways, mark both GUCs as SUSET for now.  It would be nice
to find a way to relax that someday; but the corresponding GUCs in
plperl are also SUSET, and there's not been much complaint.

Discussion: https://postgr.es/m/22067.1488046...@sss.pgh.pa.us

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/0d2b1f305dc78d536d80cfb4bb2ac4d7104453db

Modified Files
--
doc/src/sgml/pltcl.sgml  |  74 ++
src/pl/tcl/Makefile  |   2 +-
src/pl/tcl/expected/pltcl_start_proc.out |  31 ++
src/pl/tcl/pltcl.c   | 167 +--
src/pl/tcl/sql/pltcl_start_proc.sql  |  21 
5 files changed, 286 insertions(+), 9 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Clean up test_ifaddrs a bit.

2017-03-07 Thread Tom Lane
Clean up test_ifaddrs a bit.

We customarily #include  before ; according
to our git history (cf commit 527f8babc) there used to be platform(s)
where  didn't compile otherwise.  That's probably not
really an issue anymore, but since test_ifaddrs.c is the one and only
place in our code that's not following that rule, bring it into line.
Also remove #include , as that's duplicative given that
libpq/ifaddr.h does so (via pqcomm.h).

In passing, add a .gitignore file so nobody accidentally commits the
test_ifaddrs executable, as I nearly did.

I see no particular need to back-patch this, as it's just neatnik-ism
considering we don't build test_ifaddrs by default, or even document
it anywhere.

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/03cf2219346aa78ecd1b6d4501a7697692a43c62

Modified Files
--
src/tools/ifaddrs/.gitignore | 1 +
src/tools/ifaddrs/test_ifaddrs.c | 3 +--
2 files changed, 2 insertions(+), 2 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: A collection of small fixes for the SCRAM patch.

2017-03-07 Thread Heikki Linnakangas
A collection of small fixes for the SCRAM patch.

* Add required #includes for htonl. Per buildfarm members pademelon/gaur.

* Remove unnecessary "#include ".

* Fix checking for empty string in pg_SASL_init. (Reported by Peter
  Eisentraut and his compiler)

* Move code in pg_SASL_init to match the recent changes (commit ba005f193d)
  to pg_fe_sendauth() function, where it's copied from.

* Return value of malloc() was not checked for NULL in
  scram_SaltedPassword(). Fix by avoiding the malloc().

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/95c1dbcdfffcc3a77e693c3c2759e26a01f465c8

Modified Files
--
src/common/scram-common.c  | 30 ++
src/interfaces/libpq/fe-auth.c |  7 ---
2 files changed, 14 insertions(+), 23 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Consider parallel merge joins.

2017-03-07 Thread Robert Haas
Consider parallel merge joins.

Commit 45be99f8cd5d606086e0a458c9c72910ba8a613d took the position
that performing a merge join in parallel was not likely to work out
well, but this conclusion was greeted with skepticism even at the
time.  Whether it was true then or not, it's clearly not true any
more now that we have parallel index scan.

Dilip Kumar, reviewed by Amit Kapila and by me.

Discussion: 
http://postgr.es/m/CAFiTN-v3=cM6nyFwFGp0fmvY4=kk79hq9fgu0u8csj-eeq1...@mail.gmail.com

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/3bc7dafa9bebbdaa1bbf0da0798d29a8bdaf6a8f

Modified Files
--
src/backend/optimizer/path/joinpath.c | 259 --
src/test/regress/expected/select_parallel.out |  25 +++
src/test/regress/sql/select_parallel.sql  |  10 +
3 files changed, 275 insertions(+), 19 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Fix pgbench's failure to honor the documented long-form option "

2017-03-07 Thread Tom Lane
Fix pgbench's failure to honor the documented long-form option "--builtin".

Not only did it not accept --builtin as a synonym for -b, but what it did
accept as a synonym was --tpc-b (huh?), which it got even further wrong
by marking as no_argument, so that if you did try that you got a core
dump.  I suppose this is leftover from some early design for the new
switches added by commit 8bea3d221, but it's still pretty sloppy work.

Per bug #14580 from Stepan Pesternikov.  Back-patch to 9.6 where the
error was introduced.

Report: https://postgr.es/m/20170307123347.25054.73...@wrigleys.postgresql.org

Branch
--
REL9_6_STABLE

Details
---
http://git.postgresql.org/pg/commitdiff/0e2c85d130b85549da469e8a16ee1c863e2f3da4

Modified Files
--
src/bin/pgbench/pgbench.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Fix pgbench's failure to honor the documented long-form option "

2017-03-07 Thread Tom Lane
Fix pgbench's failure to honor the documented long-form option "--builtin".

Not only did it not accept --builtin as a synonym for -b, but what it did
accept as a synonym was --tpc-b (huh?), which it got even further wrong
by marking as no_argument, so that if you did try that you got a core
dump.  I suppose this is leftover from some early design for the new
switches added by commit 8bea3d221, but it's still pretty sloppy work.

Per bug #14580 from Stepan Pesternikov.  Back-patch to 9.6 where the
error was introduced.

Report: https://postgr.es/m/20170307123347.25054.73...@wrigleys.postgresql.org

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/ef2662394455578f6c57e99a7896c69bdd9fbd74

Modified Files
--
src/bin/pgbench/pgbench.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Give partitioned table "p" in regression tests a less generic na

2017-03-07 Thread Robert Haas
Give partitioned table "p" in regression tests a less generic name.

And don't drop it, so that we improve the coverage of the pg_upgrade
regression tests.

Amit Langote, per a gripe from Tom Lane

Discussion: http://postgr.es/m/9071.1488863...@sss.pgh.pa.us

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/aa56671836e6f80dc3bdc917dfc860ac10b822be

Modified Files
--
src/test/regress/expected/alter_table.out  |   1 +
src/test/regress/expected/insert.out   | 104 ++---
src/test/regress/expected/sanity_check.out |   9 ++-
src/test/regress/sql/alter_table.sql   |   1 +
src/test/regress/sql/insert.sql|  69 +--
src/test/regress/sql/sanity_check.sql  |   2 +-
6 files changed, 95 insertions(+), 91 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Fix relcache reference leak.

2017-03-07 Thread Robert Haas
Fix relcache reference leak.

Reported by Kevin Grittner.  Faulty commit identified by Tom Lane.
Patch by Amit Langote, reviewed by Michael Paquier.

Discussion: 
http://postgr.es/m/CACjxUsOHbH1=99u8mGxmLHfy5hov4ENEpvM6=3arjos7wg7...@mail.gmail.com

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/d88d06cd0783933b7103d42d3f101baa22b37292

Modified Files
--
src/backend/commands/analyze.c |  7 +--
src/test/regress/expected/truncate.out |  6 ++
src/test/regress/expected/vacuum.out   |  9 +
src/test/regress/sql/truncate.sql  |  7 +++
src/test/regress/sql/vacuum.sql| 10 ++
5 files changed, 37 insertions(+), 2 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Remove duplicated word.

2017-03-07 Thread Robert Haas
Remove duplicated word.

Amit Langote

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/508dabaf39e1f66cbe3fc54d2b66f010aa59c66b

Modified Files
--
doc/src/sgml/ref/analyze.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Re: [COMMITTERS] pgsql: Support SCRAM-SHA-256 authentication (RFC 5802 and 7677).

2017-03-07 Thread Tom Lane
Heikki Linnakangas  writes:
> I also noticed that the HPUX buildfarm members pademelon and gaur 
> failed, with this:
> /usr/ccs/bin/ld: Unsatisfied symbols:
> htonl (code)
> I will look into that too.

I think the critical part of their report is

scram-common.c: In function `scram_Hi':
scram-common.c:106: warning: implicit declaration of function `htonl'

There are two headers that we commonly include when wanting those
functions:

/* for ntohl/htonl */
#include 
#include 

I think you probably left out one or both.

regards, tom lane


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Re: [COMMITTERS] pgsql: Support SCRAM-SHA-256 authentication (RFC 5802 and 7677).

2017-03-07 Thread Heikki Linnakangas

On 03/07/2017 04:07 PM, Peter Eisentraut wrote:

On 3/7/17 07:26, Heikki Linnakangas wrote:

Support SCRAM-SHA-256 authentication (RFC 5802 and 7677).


This is probably a mistake:

fe-auth.c: In function 'pg_SASL_init':
fe-auth.c:453:24: error: logical 'or' of equal expressions [-Werror=logical-op]
   if (password == NULL || password == '\0')
^~

Did you mean password[0] == '\0'?


Thanks, will fix!

I also noticed that the HPUX buildfarm members pademelon and gaur 
failed, with this:


/usr/ccs/bin/ld: Unsatisfied symbols:
   htonl (code)

I will look into that too.

- Heikki



--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Document what values postgres_fdw sets for each parameter it set

2017-03-07 Thread Robert Haas
Document what values postgres_fdw sets for each parameter it sets.

David Rader, reviewed by me.

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/889a3f4892b271c502f74082a352447408f6292d

Modified Files
--
doc/src/sgml/postgres-fdw.sgml | 31 ++-
1 file changed, 26 insertions(+), 5 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Fix wrong word in comment.

2017-03-07 Thread Robert Haas
Fix wrong word in comment.

Third time's the charm.

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/cd87a5ed65f2b4f3bdf07c9664a64696c86d17be

Modified Files
--
src/backend/utils/adt/misc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Remove vestigial grammar support for CHARACTER ... CHARACTER SET

2017-03-07 Thread Tom Lane
Remove vestigial grammar support for CHARACTER ... CHARACTER SET option.

The SQL standard says that you should be able to write "CHARACTER SET foo"
as part of the declaration of a char-type column.  We don't implement that,
but a rough form of support has existed in gram.y since commit f10b63923.
That's now sat there for nigh 20 years without anyone fleshing it out ---
and even if someone did, the contemplated approach of having separate data
type name(s) for every character set certainly isn't what we'd do today.
Let's just remove the grammar production; if anyone is ever motivated to
work on this, reinventing the grammar support is a trivial fraction of
what they'd have to do.  And we've never documented anything about
supporting such a clause.

Per gripe from Neha Khatri.

Discussion: 
https://postgr.es/m/cafo0u+-ios5oyn5v3sbuzvfhputrrkdfex8w7h17b07rwg3...@mail.gmail.com

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/11324e408f0e3a25621c611467927c644894b30d

Modified Files
--
src/backend/parser/gram.y | 18 ++
1 file changed, 2 insertions(+), 16 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Preparatory refactoring for parallel merge join support.

2017-03-07 Thread Robert Haas
Preparatory refactoring for parallel merge join support.

Extract the logic used by hash_inner_and_outer into a separate
function, get_cheapest_parallel_safe_total_inner, so that it can
also be used to plan parallel merge joins.

Also, add a require_parallel_safe argument to the existing function
get_cheapest_path_for_pathkeys, because parallel merge join needs
to find the cheapest path for a given set of pathkeys that is
parallel-safe, not just the cheapest one overall.

Patch by me, reviewed by Dilip Kumar.

Discussion: 
http://postgr.es/m/ca+tgmoyov+dfk0mww6366dfj_xtnohqfobdrhyb7d1ozhrg...@mail.gmail.com

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/a71f10189dc10a2fe422158a2c9409e0f77c6b9e

Modified Files
--
src/backend/optimizer/path/allpaths.c |  9 ++---
src/backend/optimizer/path/joinpath.c | 23 ++-
src/backend/optimizer/path/pathkeys.c | 29 -
src/include/optimizer/paths.h |  4 +++-
4 files changed, 43 insertions(+), 22 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Fix parallel hash join path search.

2017-03-07 Thread Robert Haas
Fix parallel hash join path search.

When the very cheapest path is not parallel-safe, we want to instead use
the cheapest unparameterized path that is.  The old code searched
innerrel->cheapest_parameterized_paths, but that isn't right, because
the path we want may not be in that list.  Search innerrel->pathlist
instead.

Spotted by Dilip Kumar.

Discussion: 
http://postgr.es/m/cafitn-szceczrqm0i_w4xqsarutoufstnu32zn4rxxdcoa8...@mail.gmail.com

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/655393a022bd653e2b48dbf20b69236981e35195

Modified Files
--
src/backend/optimizer/path/joinpath.c | 8 
1 file changed, 4 insertions(+), 4 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: psql: Add \gx command

2017-03-07 Thread Stephen Frost
psql: Add \gx command

It can often be useful to use expanded mode output (\x) for just a
single query.  Introduce a \gx which acts exactly like \g except that it
will force expanded output mode for that one \gx call.  This is simpler
than having to use \x as a toggle and also means that the user doesn't
have to worry about the current state of the expanded variable, or
resetting it later, to ensure a given query is always returned in
expanded mode.

Primairly Christoph's patch, though I did tweak the documentation and help
text a bit, and re-indented the tab completion section.

Author: Christoph Berg
Reviewed By: Daniel Verite
Discussion: 
https://postgr.es/m/20170127132737.6skslelaf4txs6iw%40msg.credativ.de

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/b2678efd43f17db7dfa04e0ca076ea01275cd9bc

Modified Files
--
doc/src/sgml/ref/psql-ref.sgml | 12 
src/bin/psql/command.c |  9 +++--
src/bin/psql/common.c  |  7 +++
src/bin/psql/help.c|  1 +
src/bin/psql/settings.h|  1 +
src/bin/psql/tab-complete.c| 11 ++-
src/test/regress/expected/psql.out | 23 +++
src/test/regress/sql/psql.sql  |  7 +++
8 files changed, 64 insertions(+), 7 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Re: [COMMITTERS] pgsql: Support SCRAM-SHA-256 authentication (RFC 5802 and 7677).

2017-03-07 Thread Peter Eisentraut
On 3/7/17 07:26, Heikki Linnakangas wrote:
> Support SCRAM-SHA-256 authentication (RFC 5802 and 7677).

This is probably a mistake:

fe-auth.c: In function 'pg_SASL_init':
fe-auth.c:453:24: error: logical 'or' of equal expressions [-Werror=logical-op]
   if (password == NULL || password == '\0')
^~

Did you mean password[0] == '\0'?

-- 
Peter Eisentraut  http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Allow pg_dumpall to dump roles w/o user passwords

2017-03-07 Thread Simon Riggs
Allow pg_dumpall to dump roles w/o user passwords

Add new option --no-role-passwords which dumps roles without passwords.
Since we don’t need passwords, we choose to use pg_roles in preference
to pg_authid since access may be restricted for security reasons in
some configrations.

Robins Tharakan and Simon Riggs

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/9a83d56b38c870ce47b7651385ff2add583bf136

Modified Files
--
doc/src/sgml/ref/pg_dumpall.sgml |  13 
src/bin/pg_dump/pg_dumpall.c | 132 +--
2 files changed, 97 insertions(+), 48 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Re: [COMMITTERS] pgsql: Support SCRAM-SHA-256 authentication (RFC 5802 and 7677).

2017-03-07 Thread Heikki Linnakangas

On 03/07/2017 03:08 PM, Amit Kapila wrote:

On Tue, Mar 7, 2017 at 5:56 PM, Heikki Linnakangas
 wrote:

Support SCRAM-SHA-256 authentication (RFC 5802 and 7677).



+ * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/backend/libpq/auth-scram.c

Year in the copyright notice needs to be updated:
/2016/2017

I could see the same problem with other newly added files.


Ah, time flies..


+ * scram-common.h
+ * Declarations for helper functions used for SCRAM authentication
+ *
+ * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/common/relpath.h

file name in directory path is not matching actual file name.


Fixed, thanks!

- Heikki



--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Fix comments in SCRAM-SHA-256 patch.

2017-03-07 Thread Heikki Linnakangas
Fix comments in SCRAM-SHA-256 patch.

Amit Kapila.

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/55acfcbffd7d11db8c10cd94ba44bfe5974894e0

Modified Files
--
src/backend/libpq/auth-scram.c   | 2 +-
src/common/base64.c  | 2 +-
src/common/scram-common.c| 2 +-
src/include/common/base64.h  | 2 +-
src/include/common/scram-common.h| 4 ++--
src/include/libpq/scram.h| 2 +-
src/interfaces/libpq/fe-auth-scram.c | 2 +-
7 files changed, 8 insertions(+), 8 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Re: [COMMITTERS] pgsql: Support SCRAM-SHA-256 authentication (RFC 5802 and 7677).

2017-03-07 Thread Amit Kapila
On Tue, Mar 7, 2017 at 5:56 PM, Heikki Linnakangas
 wrote:
> Support SCRAM-SHA-256 authentication (RFC 5802 and 7677).
>

+ * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/backend/libpq/auth-scram.c

Year in the copyright notice needs to be updated:
/2016/2017

I could see the same problem with other newly added files.

+ * scram-common.h
+ * Declarations for helper functions used for SCRAM authentication
+ *
+ * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/common/relpath.h

file name in directory path is not matching actual file name.

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Ensure ThisTimeLineID is valid before START_REPLICATION

2017-03-07 Thread Simon Riggs
Ensure ThisTimeLineID is valid before START_REPLICATION

Craig Ringer

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/5ee2197767f648bc21e324e751b84d42af573b43

Modified Files
--
src/backend/replication/walsender.c | 5 +
1 file changed, 5 insertions(+)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Add regression tests for passwords.

2017-03-07 Thread Heikki Linnakangas
Add regression tests for passwords.

Michael Paquier.

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/1fff35d872321015a87ca55042384b83f51dedcf

Modified Files
--
src/test/regress/expected/password.out | 94 ++
src/test/regress/parallel_schedule |  2 +-
src/test/regress/serial_schedule   |  1 +
src/test/regress/sql/password.sql  | 73 ++
4 files changed, 169 insertions(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Support SCRAM-SHA-256 authentication (RFC 5802 and 7677).

2017-03-07 Thread Heikki Linnakangas
Support SCRAM-SHA-256 authentication (RFC 5802 and 7677).

This introduces a new generic SASL authentication method, similar to the
GSS and SSPI methods. The server first tells the client which SASL
authentication mechanism to use, and then the mechanism-specific SASL
messages are exchanged in AuthenticationSASLcontinue and PasswordMessage
messages. Only SCRAM-SHA-256 is supported at the moment, but this allows
adding more SASL mechanisms in the future, without changing the overall
protocol.

Support for channel binding, aka SCRAM-SHA-256-PLUS is left for later.

The SASLPrep algorithm, for pre-processing the password, is not yet
implemented. That could cause trouble, if you use a password with
non-ASCII characters, and a client library that does implement SASLprep.
That will hopefully be added later.

Authorization identities, as specified in the SCRAM-SHA-256 specification,
are ignored. SET SESSION AUTHORIZATION provides more or less the same
functionality, anyway.

If a user doesn't exist, perform a "mock" authentication, by constructing
an authentic-looking challenge on the fly. The challenge is derived from
a new system-wide random value, "mock authentication nonce", which is
created at initdb, and stored in the control file. We go through these
motions, in order to not give away the information on whether the user
exists, to unauthenticated users.

Bumps PG_CONTROL_VERSION, because of the new field in control file.

Patch by Michael Paquier and Heikki Linnakangas, reviewed at different
stages by Robert Haas, Stephen Frost, David Steele, Aleksander Alekseev,
and many others.

Discussion: 
https://www.postgresql.org/message-id/CAB7nPqRbR3GmFYdedCAhzukfKrgBLTLtMvENOmPrVWREsZkF8g%40mail.gmail.com
Discussion: 
https://www.postgresql.org/message-id/CAB7nPqSMXU35g%3DW9X74HVeQp0uvgJxvYOuA4A-A3M%2B0wfEBv-w%40mail.gmail.com
Discussion: https://www.postgresql.org/message-id/55192afe.6080...@iki.fi

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/818fd4a67d610991757b610755e3065fb99d80a5

Modified Files
--
contrib/pgcrypto/.gitignore   |4 -
contrib/pgcrypto/Makefile |   11 +-
doc/src/sgml/catalogs.sgml|   25 +-
doc/src/sgml/client-auth.sgml |   59 +-
doc/src/sgml/config.sgml  |7 +-
doc/src/sgml/protocol.sgml|  147 +++-
doc/src/sgml/ref/create_role.sgml |   17 +-
src/backend/access/transam/xlog.c |   24 +
src/backend/commands/user.c   |   14 +-
src/backend/libpq/Makefile|2 +-
src/backend/libpq/auth-scram.c| 1032 +
src/backend/libpq/auth.c  |  136 
src/backend/libpq/crypt.c |   27 +-
src/backend/libpq/hba.c   |3 +
src/backend/libpq/pg_hba.conf.sample  |8 +-
src/backend/utils/misc/guc.c  |1 +
src/backend/utils/misc/postgresql.conf.sample |2 +-
src/bin/initdb/initdb.c   |   21 +-
src/bin/pg_controldata/pg_controldata.c   |   12 +-
src/common/Makefile   |6 +-
src/common/base64.c   |  199 +
src/common/scram-common.c |  196 +
src/include/access/xlog.h |1 +
src/include/catalog/pg_control.h  |   11 +-
src/include/common/base64.h   |   19 +
src/include/common/scram-common.h |   62 ++
src/include/libpq/crypt.h |3 +-
src/include/libpq/hba.h   |1 +
src/include/libpq/pqcomm.h|2 +
src/include/libpq/scram.h |   35 +
src/interfaces/libpq/.gitignore   |5 +
src/interfaces/libpq/Makefile |   20 +-
src/interfaces/libpq/fe-auth-scram.c  |  640 +++
src/interfaces/libpq/fe-auth.c|  112 +++
src/interfaces/libpq/fe-auth.h|8 +
src/interfaces/libpq/fe-connect.c |   52 ++
src/interfaces/libpq/libpq-int.h  |7 +-
src/tools/msvc/Mkvcbuild.pm   |   12 +-
38 files changed, 2866 insertions(+), 77 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


[COMMITTERS] pgsql: Refactor SHA2 functions and move them to src/common/.

2017-03-07 Thread Heikki Linnakangas
Refactor SHA2 functions and move them to src/common/.

This way both frontend and backends can use them. The functions are taken
from pgcrypto, which now fetches the source files it needs from
src/common/.

A new interface is designed for the SHA2 functions, which allow linking
to either OpenSSL or the in-core stuff taken from KAME as needed.

Michael Paquier, reviewed by Robert Haas.

Discussion: 
https://www.postgresql.org/message-id/CAB7nPqTGKuTM5jiZriHrNaQeVqp5e_iT3X4BFLWY_HyHxLvySQ%40mail.gmail.com

Branch
--
master

Details
---
http://git.postgresql.org/pg/commitdiff/273c458a2b3a0fb73968020ea5e9e35eb6928967

Modified Files
--
contrib/pgcrypto/.gitignore  |4 +
contrib/pgcrypto/Makefile|9 +-
contrib/pgcrypto/internal-sha2.c |   82 ++--
contrib/pgcrypto/sha2.c  |  992 -
contrib/pgcrypto/sha2.h  |  100 
src/common/Makefile  |6 +
src/common/sha2.c| 1006 ++
src/common/sha2_openssl.c|  102 
src/include/common/sha2.h|  115 +
src/tools/msvc/Mkvcbuild.pm  |   20 +-
10 files changed, 1297 insertions(+), 1139 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers