pgsql: Improve parse representation for MERGE

2018-04-06 Thread Simon Riggs
Improve parse representation for MERGE Separation of parser data structures from executor, as requested by Tom Lane. Further improvements possible. While there, implement error for multiple VALUES clauses via parser to allow line number of error, as requested by Andres Freund. Author: Pavan Deol

Re: pgsql: Allow on-line enabling and disabling of data checksums

2018-04-06 Thread Magnus Hagander
On Fri, Apr 6, 2018 at 2:03 AM, Andrew Dunstan < andrew.duns...@2ndquadrant.com> wrote: > On Fri, Apr 6, 2018 at 5:35 AM, Magnus Hagander > wrote: > > Allow on-line enabling and disabling of data checksums > > > > This makes it possible to turn checksums on in a live cluster, without > > the prev

Re: pgsql: Allow on-line enabling and disabling of data checksums

2018-04-06 Thread Andrew Dunstan
On Fri, Apr 6, 2018 at 7:07 PM, Magnus Hagander wrote: > > > On Fri, Apr 6, 2018 at 2:03 AM, Andrew Dunstan > wrote: >> >> On Fri, Apr 6, 2018 at 5:35 AM, Magnus Hagander >> wrote: >> > Allow on-line enabling and disabling of data checksums >> > >> > This makes it possible to turn checksums on i

Re: pgsql: Allow on-line enabling and disabling of data checksums

2018-04-06 Thread Magnus Hagander
On Fri, Apr 6, 2018 at 12:41 PM, Andrew Dunstan wrote: > On Fri, Apr 6, 2018 at 7:07 PM, Magnus Hagander > wrote: > > > > > > On Fri, Apr 6, 2018 at 2:03 AM, Andrew Dunstan > > wrote: > >> > >> On Fri, Apr 6, 2018 at 5:35 AM, Magnus Hagander > >> wrote: > >> > Allow on-line enabling and disabl

pgsql: Fix compiler warning about format truncation

2018-04-06 Thread Peter Eisentraut
Fix compiler warning about format truncation Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2cd6520e78fe8bbb4ba38f6c7624c002aa8cc481 Modified Files -- src/bin/pg_verify_checksums/pg_verify_checksums.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deleti

pgsql: Improve messaging during logical replication worker startup

2018-04-06 Thread Peter Eisentraut
Improve messaging during logical replication worker startup In case the subscription is removed before the worker is fully started, give a specific error message instead of the generic "cache lookup" error. Author: Petr Jelinek Reviewed-by: Masahiko Sawada Branch -- master Details ---

pgsql: Split the SetSubscriptionRelState function into two

2018-04-06 Thread Peter Eisentraut
Split the SetSubscriptionRelState function into two We don't actually need the insert-or-update logic, so it's clearer to have separate functions for the inserting and updating. Author: Petr Jelinek Reviewed-by: Masahiko Sawada Branch -- master Details --- https://git.postgresql.org/p

pgsql: Refactor PgFdwModifyState creation/destruction into separate fun

2018-04-06 Thread Robert Haas
Refactor PgFdwModifyState creation/destruction into separate functions. Etsuro Fujita. The larger patch series of which this is a part has been reviewed by Amit Langote, David Fetter, Maksim Milyutin, Álvaro Herrera, Stephen Frost, and me. Discussion: http://postgr.es/m/5a95487e.9050...@lab.ntt.

pgsql: Enforce child constraints during COPY TO a partitioned table.

2018-04-06 Thread Robert Haas
Enforce child constraints during COPY TO a partitioned table. The previous coding inadvertently checked the constraints for the partitioned table rather than the target partition, which could lead to data in a partition that fails to satisfy some constraint on that partition. This problem seems t

pgsql: Enforce child constraints during COPY TO a partitioned table.

2018-04-06 Thread Robert Haas
Enforce child constraints during COPY TO a partitioned table. The previous coding inadvertently checked the constraints for the partitioned table rather than the target partition, which could lead to data in a partition that fails to satisfy some constraint on that partition. This problem seems t

pgsql: Add memory context identifier to portal context

2018-04-06 Thread Peter Eisentraut
Add memory context identifier to portal context Discussion: https://www.postgresql.org/message-id/6421.1522194...@sss.pgh.pa.us Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/94c1f9ba11d1241a2b3b2be7177604b26b08bc3d Modified Files -- src/backend/utils/

pgsql: Rename MemoryContextCopySetIdentifier() for clarity

2018-04-06 Thread Peter Eisentraut
Rename MemoryContextCopySetIdentifier() for clarity MemoryContextCopySetIdentifier -> MemoryContextCopyAndSetIdentifier Discussion: https://www.postgresql.org/message-id/6421.1522194...@sss.pgh.pa.us Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/bbca77623fb5e60f5

pgsql: Add default roles for file/program access

2018-04-06 Thread Stephen Frost
Add default roles for file/program access This patch adds new default roles named 'pg_read_server_files', 'pg_write_server_files', 'pg_execute_server_program' which allow an administrator to GRANT to a non-superuser role the ability to access server-side files or run programs through PostgreSQL (a

pgsql: Support new default roles with adminpack

2018-04-06 Thread Stephen Frost
Support new default roles with adminpack This provides a newer version of adminpack which works with the newly added default roles to support GRANT'ing to non-superusers access to read and write files, along with related functions (unlinking files, getting file length, renaming/removing files, sca

pgsql: Remove explicit superuser checks in favor of ACLs

2018-04-06 Thread Stephen Frost
Remove explicit superuser checks in favor of ACLs This removes the explicit superuser checks in the various file-access functions in the backend, specifically pg_ls_dir(), pg_read_file(), pg_read_binary_file(), and pg_stat_file(). Instead, EXECUTE is REVOKE'd from public for these, meaning that o

pgsql: Faster partition pruning

2018-04-06 Thread Alvaro Herrera
Faster partition pruning Add a new module backend/partitioning/partprune.c, implementing a more sophisticated algorithm for partition pruning. The new module uses each partition's "boundinfo" for pruning instead of constraint exclusion, based on an idea proposed by Robert Haas of a "pruning progr

pgsql: Clean up intermetiate state in pg_basebackup tests

2018-04-06 Thread Magnus Hagander
Clean up intermetiate state in pg_basebackup tests These tests accummulated almost a gigabyte of data during the test which was then removed at the end. Instead, remove output that's no longer needed between the individual tests, to keep the total disk usage down lower. Author: Michael Banck Bra

pgsql: Fix typo

2018-04-06 Thread Magnus Hagander
Fix typo Author: Michael Banck Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/f66c37b2f7b99d1216da9b6267793cfbdc2e58c4 Modified Files -- src/bin/pg_basebackup/t/010_pg_basebackup.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Fix badly edited doc sentence

2018-04-06 Thread Alvaro Herrera
Fix badly edited doc sentence Noted by Vik Fearing and Robert Haas Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3cabe3863015efc72d513d3aa3b47d03eed96f49 Modified Files -- doc/src/sgml/ref/create_table.sgml | 5 ++--- 1 file changed, 2 insertions(+), 3

pgsql: Remove some unnecessary quote marks from catalog DATA lines.

2018-04-06 Thread Tom Lane
Remove some unnecessary quote marks from catalog DATA lines. This has no functional impact whatsoever. However, it causes these unnecessary quote marks to disappear from the generated postgres.bki file, making it easier to verify that the upcoming bootstrap data conversion patch doesn't change th

pgsql: Allow insert and update tuple routing and COPY for foreign table

2018-04-06 Thread Robert Haas
Allow insert and update tuple routing and COPY for foreign tables. Also enable this for postgres_fdw. Etsuro Fujita, based on an earlier patch by Amit Langote. The larger patch series of which this is a part has been reviewed by Amit Langote, David Fetter, Maksim Milyutin, Álvaro Herrera, Stephen

pgsql: Fix possible failure in parallel index build.

2018-04-06 Thread Robert Haas
Fix possible failure in parallel index build. Report and proposed fix by David Rowley, put in patch form by Peter Geoghegan. Discussion: http://postgr.es/m/CAKJS1f91kq1wfYR8rnRRfKtxyhU2woEA+=whd640uxmyu+o...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/comm

pgsql: Doc: fix broken markup.

2018-04-06 Thread Tom Lane
Doc: fix broken markup. Commit 3d956d956 was apparently not checked against HEAD's doc toolchain. Per buildfarm. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/eb2a0e00b18aedabd76f5442e38f4bf5d1b94974 Modified Files -- doc/src/sgml/ddl.sgml | 2 +- 1 fi

pgsql: Fix and improve pg_atomic_flag fallback implementation.

2018-04-06 Thread Andres Freund
Fix and improve pg_atomic_flag fallback implementation. The atomics fallback implementation for pg_atomic_flag was broken, returning the inverted value from pg_atomic_test_set_flag(). This was unnoticed because a) atomic flags were unused until recently b) the test code wasn't run when the fallba

pgsql: Fix and improve pg_atomic_flag fallback implementation.

2018-04-06 Thread Andres Freund
Fix and improve pg_atomic_flag fallback implementation. The atomics fallback implementation for pg_atomic_flag was broken, returning the inverted value from pg_atomic_test_set_flag(). This was unnoticed because a) atomic flags were unused until recently b) the test code wasn't run when the fallba

pgsql: Fix and improve pg_atomic_flag fallback implementation.

2018-04-06 Thread Andres Freund
Fix and improve pg_atomic_flag fallback implementation. The atomics fallback implementation for pg_atomic_flag was broken, returning the inverted value from pg_atomic_test_set_flag(). This was unnoticed because a) atomic flags were unused until recently b) the test code wasn't run when the fallba

pgsql: Fix and improve pg_atomic_flag fallback implementation.

2018-04-06 Thread Andres Freund
Fix and improve pg_atomic_flag fallback implementation. The atomics fallback implementation for pg_atomic_flag was broken, returning the inverted value from pg_atomic_test_set_flag(). This was unnoticed because a) atomic flags were unused until recently b) the test code wasn't run when the fallba

pgsql: Attempt to fix endianess issues in new hash partition test.

2018-04-06 Thread Andres Freund
Attempt to fix endianess issues in new hash partition test. The tests added as part of 9fdb675fc5 yield differing results depending on endianess, causing buildfarm failures. As the differences are expected, split the hash partitioning tests into a different file and maintain alternative output. Th

pgsql: Blindly attempt to fix sepgsql tests broken due to 9fdb675fc5.

2018-04-06 Thread Andres Freund
Blindly attempt to fix sepgsql tests broken due to 9fdb675fc5. The failure appears to solely be caused by the changed partition pruning logic. Author: Andres Freund Discussion: https://postgr.es/m/20180406210330.wmqw42wqgiick...@alap3.anarazel.de Branch -- master Details --- https://gi