[COMMITTERS] pgsql: Fix example on creating a trigger with a transition table.

2017-04-18 Thread Heikki Linnakangas
Fix example on creating a trigger with a transition table.

Yugo Nagata

Discussion: 
https://www.postgresql.org/message-id/20170417180921.3047f3b0.nag...@sraoss.co.jp

Branch
--
master

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

Modified Files
--
doc/src/sgml/ref/create_trigger.sgml | 4 ++--
1 file 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: Allow COMMENT ON COLUMN with partitioned tables

2017-04-18 Thread Simon Riggs
Allow COMMENT ON COLUMN with partitioned tables

Amit Langote

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/51175f3638524231405e674e40bde159b0b76727

Modified Files
--
src/backend/commands/comment.c |  3 ++-
src/test/regress/expected/create_table.out | 19 +++
src/test/regress/sql/create_table.sql  |  8 
3 files changed, 29 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: Don’t push nextid too far forwards in recovery

2017-04-18 Thread Simon Riggs
Don’t push nextid too far forwards in recovery

Doing so allows various crash possibilities. Fix by avoiding
having PrescanPreparedTransactions() increment
ShmemVariableCache->nextXid when it has no 2PC files

Bug found by Jeff Janes, diagnosis and patch by Pavan Deolasee,
then patch re-designed for clarity and full accuracy by
Michael Paquier.

Reported-by: Jeff Janes
Author: Pavan Deolasee, Michael Paquier
Discussion: 
https://postgr.es/m/CAMkU=1zmlnh_i1-pvq-bizzvnx7vcuatriquenh7hnk6k8s...@mail.gmail.com

Branch
--
master

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

Modified Files
--
src/backend/access/transam/twophase.c | 77 ---
1 file changed, 36 insertions(+), 41 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: Exit correctly from PrepareRedoRemove() when not found

2017-04-18 Thread Simon Riggs
Exit correctly from PrepareRedoRemove() when not found

Complex crash bug all started with this failure.
Diagnosed and fixed by Nikhil Sontakke, reviewed by me.

Reported-by: Jeff Janes
Author: Nikhil Sontakke
Discussion: 
https://postgr.es/m/CAMkU=1xBP8cqdS5eK8APHL=x6rhmmm2vg5g+qamduutsycw...@mail.gmail.com

Branch
--
master

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

Modified Files
--
src/backend/access/transam/twophase.c | 4 +++-
1 file changed, 3 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: Fix minor typo in comment

2017-04-18 Thread Simon Riggs
Fix minor typo in comment

Reported-by: Amit Langote

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/123aaffb5b881f3dadaac676877a90b50233a847

Modified Files
--
src/backend/catalog/partition.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: Rename "scram" to "scram-sha-256" in pg_hba.conf and password_en

2017-04-18 Thread Heikki Linnakangas
Rename "scram" to "scram-sha-256" in pg_hba.conf and password_encryption.

Per discussion, plain "scram" is confusing because we actually implement
SCRAM-SHA-256 rather than the original SCRAM that uses SHA-1 as the hash
algorithm. If we add support for SCRAM-SHA-512 or some other mechanism in
the SCRAM family in the future, that would become even more confusing.

Most of the internal files and functions still use just "scram" as a
shorthand for SCRMA-SHA-256, but I did change PASSWORD_TYPE_SCRAM to
PASSWORD_TYPE_SCRAM_SHA_256, as that could potentially be used by 3rd
party extensions that hook into the password-check hook.

Michael Paquier did this in an earlier version of the SCRAM patch set
already, but I didn't include that in the version that was committed.

Discussion: 
https://www.postgresql.org/message-id/fde71ff1-5858-90c8-99a9-1c2427e7b...@iki.fi

Branch
--
master

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

Modified Files
--
doc/src/sgml/client-auth.sgml | 15 ---
doc/src/sgml/config.sgml  |  4 ++--
src/backend/commands/user.c   |  8 
src/backend/libpq/auth-scram.c|  2 +-
src/backend/libpq/auth.c  | 16 
src/backend/libpq/crypt.c | 10 +-
src/backend/libpq/hba.c   |  4 ++--
src/backend/libpq/pg_hba.conf.sample  |  8 
src/backend/utils/misc/guc.c  |  2 +-
src/bin/initdb/initdb.c   | 16 
src/include/libpq/crypt.h |  2 +-
src/test/authentication/t/001_password.pl | 14 +++---
src/test/authentication/t/002_saslprep.pl |  4 ++--
src/test/regress/expected/password.out|  8 
src/test/regress/sql/password.sql |  6 +++---
15 files changed, 60 insertions(+), 59 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: Simplify docs on creating a self-signed SSL certificate

2017-04-18 Thread Andrew Dunstan
Simplify docs on creating a self-signed SSL certificate

Discussion: 


Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/2b67c9d207d428c2476af0dd39043d83469d70c2

Modified Files
--
doc/src/sgml/runtime.sgml | 26 ++
1 file changed, 6 insertions(+), 20 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: Update copyright for 2017

2017-04-18 Thread Masahiko Sawada
On Sat, Jan 7, 2017 at 1:14 AM, Bruce Momjian  wrote:
> On Wed, Jan  4, 2017 at 10:05:10AM -0500, Tom Lane wrote:
>> Andres Freund  writes:
>> > On 2017-01-03 13:02:28 -0500, Bruce Momjian wrote:
>> >> Yeah, I was doing parallel pulls of different branches in git via shell
>> >> script, and it seems the size of this commit showed me that doesn't
>> >> work.  Sorry.
>>
>> > Shouldn't you check the results of something like this before pushing?
>> > Sorry for piling on, but that seems like a quite critical step.
>>
>> Actually, my takeaway from this was "don't ever use git reset on the repo".
>> "git revert" would have been much safer.  Yeah, it would have meant that
>> git blame on the 9.2 branch would have some useless noise, but how much
>> does anyone still care about that?
>
> FYI, my takeaway is that you can't run parallel 'git pull' operations on
> different branches checked out of the same tree, at least as setup from
> instructions on our wiki.   Such parallel operations generate messages
> indicating someone else is working on the tree, but I now realize those
> are _warnings_ and this behavior should be avoided.  Normally it works
> fine, but for a big commit, it can move a changeset from one branch to
> another, with disastrous consequences.
>
> Yes, I should have checked more, but I often do a pull before a push as
> another check, so that can mess it up too.  Basically, if your tools are
> being used improperly, checking can make things worse too.
>
> --
>   Bruce Momjian  http://momjian.us
>   EnterpriseDB http://enterprisedb.com
>
> + As you are, so once was I.  As I am, so you will be. +
> +  Ancient Roman grave inscription +
>
>
> --
> Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-committers

Hi,

During reading source code, I noticed that updating copyright for 2017
has been missing in some files. Attached patch fixes it.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


update_copyright.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: Also fix comment in sample postgresql.conf file, for "scram-sha-

2017-04-18 Thread Heikki Linnakangas
Also fix comment in sample postgresql.conf file, for "scram-sha-256".

Reported offlist by hubert depesz lubaczewski.

Branch
--
master

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

Modified Files
--
src/backend/utils/misc/postgresql.conf.sample | 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: Use DatumGetInt32() to extract 32-bit integer value from a datum

2017-04-18 Thread Fujii Masao
Use DatumGetInt32() to extract 32-bit integer value from a datum.

Previously DatumGetObjectId() was wrongly used for that.

Author: Masahiko Sawada
Reviewed-by: Kyotaro Horiguchi
Reported-by: Fujii Masao
Discussion: 
http://postgr.es/m/CAHGQGwFDWh_Qr-q_GEMpD+qH=vYPMdVqw=zosy3kx_pna9r...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/39a6772d04940b994acd9a3fd954cacdc2f88b26

Modified Files
--
src/backend/replication/logical/launcher.c | 2 +-
src/backend/replication/logical/worker.c   | 2 +-
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 logical replication.

2017-04-18 Thread Fujii Masao
A collection of small fixes for logical replication.

* Be sure to reset the launcher's pid (LogicalRepCtx->launcher_pid) to 0
  even when the launcher emits an error.

* Declare ApplyLauncherWakeup() as a static function because it's called
  only in launcher.c.

* Previously IsBackendPId() was used to check whether the launcher's pid
  was valid. IsBackendPid() was necessary because there was the bug where
  the launcher's pid was not reset to 0. But now it's fixed, so IsBackendPid()
  is not necessary and this patch removes it.

Author: Masahiko Sawada
Reviewed-by: Kyotaro Horiguchi
Reported-by: Fujii Masao
Discussion: 
http://postgr.es/m/CAHGQGwFDWh_Qr-q_GEMpD+qH=vYPMdVqw=zosy3kx_pna9r...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/280c53ecfbcad442c4b5eaab4cc3e65408f486eb

Modified Files
--
src/backend/replication/logical/launcher.c | 19 +--
src/include/replication/logicallauncher.h  |  1 -
2 files changed, 17 insertions(+), 3 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: Provide an error cursor for "can't call an SRF here" errors.

2017-04-18 Thread Tom Lane
Provide an error cursor for "can't call an SRF here" errors.

Since it appears that v10 is going to move the goalposts by some amount
in terms of where you can and can't invoke set-returning functions,
arrange for the executor's "set-valued function called in context that
cannot accept a set" errors to include a syntax position if possible,
pointing to the specific SRF that can't be called where it's located.

The main bit of infrastructure needed for this is to make the query source
text accessible in the executor; but it turns out that commit 4c728f382
already did that.  We just need a new function executor_errposition()
modeled on parser_errposition(), and we're ready to rock.

While experimenting with this, I noted that the error position wasn't
properly reported if it occurred in a plpgsql FOR-over-query loop,
which turned out to be because SPI_cursor_open_internal wasn't providing
an error context callback during PortalStart.  Fix that.

There's a whole lot more that could be done with this infrastructure
now that it's there, but this is not the right time in the development
cycle for that sort of work.  Hence, resist the temptation to plaster
executor_errposition() calls everywhere ... for the moment.

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

Branch
--
master

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

Modified Files
--
src/backend/executor/execExpr.c|  4 +++-
src/backend/executor/execSRF.c | 16 ++--
src/backend/executor/execUtils.c   | 33 +
src/backend/executor/spi.c |  6 +++---
src/include/executor/executor.h|  2 ++
src/test/regress/expected/tsrf.out |  6 ++
6 files changed, 57 insertions(+), 10 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 documentation and comment for quorum-based sync replicat

2017-04-18 Thread Fujii Masao
Improve documentation and comment for quorum-based sync replication.

Author: Masahiko Sawada, heavily modified by me
Discussion: 
http://postgr.es/m/CAHGQGwEKOw=smplxjzkbsh6wwdbgonvz46qjhbtsiz-d-2r...@mail.gmail.com

Branch
--
master

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

Modified Files
--
doc/src/sgml/high-availability.sgml | 21 -
src/backend/replication/syncrep.c   |  5 +
2 files changed, 21 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: Doc: improve markup in self-signed certificate example.

2017-04-18 Thread Tom Lane
Doc: improve markup in self-signed certificate example.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/539f67012ec978e931054e413a4ab3c4c68bb737

Modified Files
--
doc/src/sgml/runtime.sgml | 6 +++---
1 file changed, 3 insertions(+), 3 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 testing of parallel-safety of SubPlans.

2017-04-18 Thread Tom Lane
Fix testing of parallel-safety of SubPlans.

is_parallel_safe() supposed that the only relevant property of a SubPlan
was the parallel safety of the referenced subplan tree.  This is wrong:
the testexpr or args subtrees might contain parallel-unsafe stuff, as
demonstrated by the test case added here.  However, just recursing into the
subtrees fails in a different way: we'll typically find PARAM_EXEC Params
representing the subplan's output columns in the testexpr.  The previous
coding supposed that any Param must be treated as parallel-restricted, so
that a naive attempt at fixing this disabled parallel pushdown of SubPlans
altogether.  We must instead determine, for any visited Param, whether it
is one that would be computed by a surrounding SubPlan node; if so, it's
safe to push down along with the SubPlan node.

We might later be able to extend this logic to cope with Params used for
correlated subplans and other cases; but that's a task for v11 or beyond.

Tom Lane and Amit Kapila

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

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/39151781c8cd2c8bf6057496426fb9c07178eda5

Modified Files
--
src/backend/optimizer/util/clauses.c  | 44 ---
src/include/nodes/primnodes.h |  3 +-
src/test/regress/expected/select_parallel.out | 12 
src/test/regress/sql/select_parallel.sql  |  4 +++
4 files changed, 57 insertions(+), 6 deletions(-)


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