[COMMITTERS] pgsql: Account for the effect of lossy pages when costing bitmap scans.

2017-11-10 Thread Robert Haas
Account for the effect of lossy pages when costing bitmap scans.

Dilip Kumar, reviewed by Alexander Kumenkov, Amul Sul, and me.
Some final adjustments by me.

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

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/5edc63bda68a77c4d38f0cbeae1c4271f9ef4100

Modified Files
--
src/backend/nodes/tidbitmap.c | 37 +++---
src/backend/optimizer/path/costsize.c | 59 +--
src/include/nodes/tidbitmap.h |  1 +
3 files changed, 75 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 incorrect comment.

2017-11-10 Thread Robert Haas
Fix incorrect comment.

Etsuro Fujita

Discussion: http://postgr.es/m/5a05728e.4050...@lab.ntt.co.jp

Branch
--
master

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

Modified Files
--
src/backend/optimizer/util/relnode.c | 3 +--
1 file changed, 1 insertion(+), 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: Add hash partitioning.

2017-11-09 Thread Robert Haas
Add hash partitioning.

Hash partitioning is useful when you want to partition a growing data
set evenly.  This can be useful to keep table sizes reasonable, which
makes maintenance operations such as VACUUM faster, or to enable
partition-wise join.

At present, we still depend on constraint exclusion for partitioning
pruning, and the shape of the partition constraints for hash
partitioning is such that that doesn't work.  Work is underway to fix
that, which should both improve performance and make partitioning
pruning work with hash partitioning.

Amul Sul, reviewed and tested by Dilip Kumar, Ashutosh Bapat, Yugo
Nagata, Rajkumar Raghuwanshi, Jesper Pedersen, and by me.  A few
final tweaks also by me.

Discussion: 
http://postgr.es/m/CAAJ_b96fhpJAP=albetmelk1uni_gfzd938zgenhf49qgdt...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/1aba8e651ac3e37e1d2d875842de1e0ed22a651e

Modified Files
--
doc/src/sgml/ddl.sgml|  28 +-
doc/src/sgml/ref/alter_table.sgml|   7 +
doc/src/sgml/ref/create_table.sgml   |  85 +++-
src/backend/catalog/partition.c  | 682 ---
src/backend/commands/tablecmds.c |  48 +-
src/backend/nodes/copyfuncs.c|   2 +
src/backend/nodes/equalfuncs.c   |   2 +
src/backend/nodes/outfuncs.c |   2 +
src/backend/nodes/readfuncs.c|   2 +
src/backend/optimizer/path/joinrels.c|  12 +-
src/backend/parser/gram.y|  76 ++-
src/backend/parser/parse_utilcmd.c   |  29 +-
src/backend/utils/adt/ruleutils.c|  15 +-
src/backend/utils/cache/relcache.c   |  26 +-
src/bin/psql/tab-complete.c  |   2 +-
src/include/catalog/catversion.h |   2 +-
src/include/catalog/partition.h  |   3 +
src/include/catalog/pg_proc.h|   4 +
src/include/nodes/parsenodes.h   |   8 +-
src/test/regress/expected/alter_table.out|  62 +++
src/test/regress/expected/create_table.out   |  78 ++-
src/test/regress/expected/insert.out |  46 ++
src/test/regress/expected/partition_join.out |  81 
src/test/regress/expected/update.out |  29 ++
src/test/regress/sql/alter_table.sql |  64 +++
src/test/regress/sql/create_table.sql|  51 +-
src/test/regress/sql/insert.sql  |  33 ++
src/test/regress/sql/partition_join.sql  |  32 ++
src/test/regress/sql/update.sql  |  28 ++
src/tools/pgindent/typedefs.list |   1 +
30 files changed, 1420 insertions(+), 120 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 typo in comment.

2017-11-07 Thread Robert Haas
Fix typo in comment.

Masahiko Sawada

Discussion: 
http://postgr.es/m/CAD21AoDrf5AOpZ-mX-j6O=zfnffkatdhkv3o1x2ess2nbxa...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/698e5254377baffb95774d47872100997f135cba

Modified Files
--
src/backend/storage/ipc/dsm_impl.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: [HACKERS] [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple

2017-11-02 Thread Robert Haas
On Thu, Nov 2, 2017 at 10:38 PM, Tom Lane <t...@sss.pgh.pa.us> wrote:
>> Personally, I think it would be best to push the release out a week.
>
> I would only be in favor of that if there were some reason to think that
> the bug is worse now than it's been in the four years since 9.3 was
> released.  Otherwise, we should ship the bug fixes we have on-schedule.
> I think it's a very very safe bet that there are other data-loss-causing
> bugs in there, so I see no good reason for panicking over this one.

Well, my thought was that delaying this release for a week would be
better than either (a) doing an extra minor release just to get this
fix out or (b) waiting another three months to release this fix.  The
former seems like fairly unnecessary work, and the latter doesn't seem
particularly responsible.  Users can't reasonably expect us to fix
data-loss-causing bugs that we don't know about yet, but they can
reasonably expect us to issue fixes promptly for ones that we do know
about.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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


Re: [HACKERS] [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple

2017-11-02 Thread Robert Haas
On Thu, Nov 2, 2017 at 10:26 PM, Peter Geoghegan <p...@bowt.ie> wrote:
> On Thu, Nov 2, 2017 at 9:44 AM, Robert Haas <robertmh...@gmail.com> wrote:
>> The second commit (22576734b805fb0952f9be841ca8f643694ee868) is where
>> I think things get a lot more dangerous.  The problem (as Andres
>> pointed out to me this afternoon) is that it seems possible to end up
>> with a situation where there should be two HOT chains on a page, and
>> because of the weakened xmin/xmax checking rules, we end up thinking
>> that the second one is a continuation of the first one, which will be
>> all kinds of bad news.  That would be particularly likely to happen in
>> releases from before we invented HEAP_XMIN_FROZEN, when there's no
>> xmin/xmax matching at all, but could happen on later releases if we
>> are extraordinarily unlucky (i.e. xmin of the first tuple in the
>> second chain happens to be the same as the pre-freeze xmax in the old
>> chain, probably because the same XID was used to update the page in
>> two consecutive epochs).  Fortunately, that commit is (I think) not
>> released anywhere.
>
> FWIW, if you look at the second commit
> (22576734b805fb0952f9be841ca8f643694ee868) carefully, you'll realize
> that it doesn't even treat those two cases differently. It was buggy
> even on its own terms. The FrozenTransactionId test used an xmin from
> HeapTupleHeaderGetXmin(), not HeapTupleHeaderGetRawXmin().

Oh, wow.  You seem to be correct.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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


Re: [HACKERS] [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple

2017-11-02 Thread Robert Haas
On Thu, Nov 2, 2017 at 8:25 PM, Alvaro Herrera <alvhe...@alvh.no-ip.org> wrote:
> Pushed the reverts.
>
> I noticed while doing so that REL_10_STABLE contains the bogus commits.
> Does that change our opinion regarding what to do for people upgrading
> to a version containing the broken commits?  I don't think so, because
>
>   1) we hope that not many people will trust their data to 10.0
>  immediately after release
>   2) the bug is very low probability
>   3) it doesn't look like we can do a lot about it anyway.

Just to be clear, it looks like "Fix freezing of a dead HOT-updated
tuple" (46c35116ae1acc8826705ef2a7b5d9110f9d6e84) went in before 10.0
was stamped, but "Fix traversal of half-frozen update chains"
(22576734b805fb0952f9be841ca8f643694ee868) went in afterwards and is
therefore unreleased at present.

Users of 10.0 who hit the code introduced by
46c35116ae1acc8826705ef2a7b5d9110f9d6e84 will have XIDs stored in the
xmax fields of tuples that predate relfrozenxid.  Those tuples will be
hinted-committed.  That's not good, but it might not really have much
in the way of consequences.  *IF* the next VACUUM doesn't get confused
by the old XID, then it will prune the tuple then and I think we'll be
OK.  And I think it won't, because it should just call
HeapTupleSatisfiesVacuum() and that should see that
HEAP_XMAX_COMMITTED is set and not actually try to consult the old
CLOG.  If that hint bit can ever get lost - or fail to propagate to a
standby - then we have more trouble, but the fact that it's set by a
logged operation makes me hope that can't happen. Furthermore, that
follow-on VACUUM should indeed arrive in due time, because we will not
have marked the page all-visible -- HeapTupleSatisfiesVacuum() will
NOT have returned HEAPTUPLE_LIVE when called from lazy_scan_heap(),
and therefore we will have set all_visible = false.

The second commit (22576734b805fb0952f9be841ca8f643694ee868) is where
I think things get a lot more dangerous.  The problem (as Andres
pointed out to me this afternoon) is that it seems possible to end up
with a situation where there should be two HOT chains on a page, and
because of the weakened xmin/xmax checking rules, we end up thinking
that the second one is a continuation of the first one, which will be
all kinds of bad news.  That would be particularly likely to happen in
releases from before we invented HEAP_XMIN_FROZEN, when there's no
xmin/xmax matching at all, but could happen on later releases if we
are extraordinarily unlucky (i.e. xmin of the first tuple in the
second chain happens to be the same as the pre-freeze xmax in the old
chain, probably because the same XID was used to update the page in
two consecutive epochs).  Fortunately, that commit is (I think) not
released anywhere.

Personally, I think it would be best to push the release out a week.
I think we understand this well enough now that we can fix it
relatively easily, but haste makes bugs, and (I know you're all tired
of hearing me say this) patches that implicate the on-disk format are
scary.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
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 freezing of a dead HOT-updated tuple

2017-11-02 Thread Robert Haas
On Thu, Nov 2, 2017 at 4:50 PM, Andres Freund <and...@anarazel.de> wrote:
> I think a5736bf754c82d8b86674e199e232096c679201d might be dangerous in
> the face of previously corrupted tuple chains and pg_upgraded clusters -
> it can lead to tuples being considered related, even though they they're
> from entirely independent hot chains. Especially when upgrading 9.3 post
> your fix, to current releases.

I think this is a key point.  If the new behavior were merely not
entirely correct, we could perhaps refine it later.  But it's not only
not correct - it actually has the potential to create new problems
that didn't exist before those commits.  And if we release without
reverting those commits then we can't change our mind later.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
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 exaggerate the number of temporary blocks read.

2017-10-31 Thread Robert Haas
Don't exaggerate the number of temporary blocks read.

A read that returns zero bytes (or an error) should not increment
the number of temporary blocks read.

Thomas Munro

Discussion: 
http://postgr.es/m/CAEepm=21xgihg=wag+o5mfotezfn6kfetpfw+rksneqnqqg...@mail.gmail.com

Branch
--
master

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

Modified Files
--
src/backend/storage/file/buffile.c | 3 ++-
1 file changed, 2 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 code related to partitioning schemes for dropped columns.

2017-10-31 Thread Robert Haas
Fix code related to partitioning schemes for dropped columns.

The entry in appinfo->translated_vars can be NULL; if so, we must avoid
dereferencing it.

Ashutosh Bapat

Discussion: 
http://postgr.es/m/CAFjFpReL7+1ien=-21rhjpo3bv7aam1rq8xglvk2csfagsz...@mail.gmail.com

Branch
--
master

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

Modified Files
--
src/backend/optimizer/path/allpaths.c | 12 
src/test/regress/expected/alter_table.out |  7 +++
src/test/regress/sql/alter_table.sql  |  4 
3 files changed, 23 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 sanity check for pg_proc.provariadic

2017-10-30 Thread Robert Haas
Add sanity check for pg_proc.provariadic

Check that the values from pg_proc.h match what ProcedureCreate would
have done.

Robert Haas and Amul Sul

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

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/35f059e9bdfb3b14ac9d22a9e159d36ec0ccf804

Modified Files
--
src/test/regress/expected/type_sanity.out | 18 ++
src/test/regress/sql/type_sanity.sql  | 16 
2 files changed, 34 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: Allow parallel query for prepared statements with generic plans.

2017-10-29 Thread Robert Haas
Allow parallel query for prepared statements with generic plans.

This was always intended to work, but due to an oversight in
max_parallel_hazard_walker, it didn't.  In testing, we missed the
fact that it was only working for custom plans, where the parameter
value has been substituted for the parameter itself early enough
that everything worked.  In a generic plan, the Param node survives
and must be treated as parallel-safe.  SerializeParamList provides
for the transmission of parameter values to workers.

Amit Kapila with help from Kuntal Ghosh.  Some changes by me.

Discussion: 
http://postgr.es/m/caa4ek1+_buzrmvceua5eqnm4co9daxdm5hpaoe2j19epbr9...@mail.gmail.com

Branch
--
REL_10_STABLE

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

Modified Files
--
src/backend/optimizer/util/clauses.c  |  8 +++-
src/pl/plpgsql/src/pl_exec.c  | 63 +++
src/test/regress/expected/select_parallel.out | 20 +
src/test/regress/sql/select_parallel.sql  |  6 +++
4 files changed, 76 insertions(+), 21 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 problems with the "role" GUC and parallel query.

2017-10-29 Thread Robert Haas
Fix problems with the "role" GUC and parallel query.

Without this fix, dropping a role can sometimes result in parallel
query failures in sessions that have used "SET ROLE" to assume the
dropped role, even if that setting isn't active any more.

Report by Pavan Deolasee.  Patch by Amit Kapila, reviewed by me.

Discussion: 
http://postgr.es/m/caboikdoomrczslslk+z+qenm1zxyawnavfh3mjzzznnkif+...@mail.gmail.com

Branch
--
REL_10_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/69125c883df30e6232412d35bf7c89b8c3ad1305

Modified Files
--
src/backend/access/transam/parallel.c | 11 +++
src/backend/utils/misc/guc.c  | 25 +
src/include/utils/guc.h   |  1 +
src/test/regress/expected/select_parallel.out | 16 
src/test/regress/sql/select_parallel.sql  | 11 +++
5 files changed, 48 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: Fix problems with the "role" GUC and parallel query.

2017-10-29 Thread Robert Haas
Fix problems with the "role" GUC and parallel query.

Without this fix, dropping a role can sometimes result in parallel
query failures in sessions that have used "SET ROLE" to assume the
dropped role, even if that setting isn't active any more.

Report by Pavan Deolasee.  Patch by Amit Kapila, reviewed by me.

Discussion: 
http://postgr.es/m/caboikdoomrczslslk+z+qenm1zxyawnavfh3mjzzznnkif+...@mail.gmail.com

Branch
--
REL9_6_STABLE

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

Modified Files
--
src/backend/access/transam/parallel.c | 11 +++
src/backend/utils/misc/guc.c  | 25 +
src/include/utils/guc.h   |  1 +
src/test/regress/expected/select_parallel.out | 14 ++
src/test/regress/sql/select_parallel.sql  |  8 
5 files changed, 43 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: Fix problems with the "role" GUC and parallel query.

2017-10-29 Thread Robert Haas
Fix problems with the "role" GUC and parallel query.

Without this fix, dropping a role can sometimes result in parallel
query failures in sessions that have used "SET ROLE" to assume the
dropped role, even if that setting isn't active any more.

Report by Pavan Deolasee.  Patch by Amit Kapila, reviewed by me.

Discussion: 
http://postgr.es/m/caboikdoomrczslslk+z+qenm1zxyawnavfh3mjzzznnkif+...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/846fcc85167c417873865099d70068ed85f758a8

Modified Files
--
src/backend/access/transam/parallel.c | 11 +++
src/backend/utils/misc/guc.c  | 25 +
src/include/utils/guc.h   |  1 +
src/test/regress/expected/select_parallel.out | 16 
src/test/regress/sql/select_parallel.sql  | 11 +++
5 files changed, 48 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: pg_receivewal: Add --no-sync option.

2017-10-29 Thread Robert Haas
pg_receivewal: Add --no-sync option.

Michael Paquier, reviewed by Kuntal Ghosh and by me.  I did a little
wordsmithing on the documentation, too.

Discussion: 
http://postgr.es/m/CAB7nPqTuXuyEoVKcWcExh_b0uAjgWd_14KfGLrCTccBZ=va...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/5f3971291fc231bb65a38198b1bcb1c29ef63108

Modified Files
--
doc/src/sgml/ref/pg_receivewal.sgml  | 17 +
src/bin/pg_basebackup/pg_receivewal.c| 16 +++-
src/bin/pg_basebackup/t/020_pg_receivewal.pl |  5 -
3 files changed, 36 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: Add hash_combine64.

2017-10-29 Thread Robert Haas
Add hash_combine64.

Extracted from a larger patch by Amul Sul, with some comment additions
by me.

Discussion: http://postgr.es/m/20171024113004.hn5qajypin4dy...@alap3.anarazel.de

Branch
--
master

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

Modified Files
--
src/include/utils/hashutils.h | 16 ++--
1 file changed, 14 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: Fix typo.

2017-10-28 Thread Robert Haas
Fix typo.

Eiji Seki

Discussion: 
http://postgr.es/m/A11BD0E1A40FAC479D740CEFA373E203397E5276@g01jpexmbkw05

Branch
--
master

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

Modified Files
--
contrib/bloom/blvacuum.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: Improve comments for parallel executor estimation functions.

2017-10-28 Thread Robert Haas
Improve comments for parallel executor estimation functions.

The previous comment (which was copied as boilerplate from one file
to the next) implied that it was the executor node itself which was
being serialized, but that's not right.  We're not serializing
the executor nodes; we're just allowing them to store some
additional information in DSM.  Adjusts the comment to reflect this.

Discussion: 
http://postgr.es/m/CA+TgmoaHVinxG=3h6qBAsyV8xaDyQwbzK7YZnYfE8nJFMK1=f...@mail.gmail.com

Branch
--
master

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

Modified Files
--
src/backend/executor/nodeBitmapHeapscan.c | 3 ++-
src/backend/executor/nodeIndexonlyscan.c  | 3 ++-
src/backend/executor/nodeIndexscan.c  | 3 ++-
src/backend/executor/nodeSeqscan.c| 3 ++-
4 files changed, 8 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: Add table_constraint synopsis to ALTER TABLE documentation.

2017-10-28 Thread Robert Haas
Add table_constraint synopsis to ALTER TABLE documentation.

This is already present in the CREATE TABLE documentation, but it's
nicer not to have to refer to CREATE TABLE to find out the syntax
for ALTER TABLE.

Lætitia Avrot

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/9f295c08f8776213ccb592de0c4f094738d6d841

Modified Files
--
doc/src/sgml/ref/alter_table.sgml | 11 +++
1 file changed, 11 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: Fix grammar.

2017-10-28 Thread Robert Haas
Fix grammar.

Etsuro Fujita

Discussion: 
http://postgr.es/m/cc7767b6-6a1b-74a2-8b3c-48b8e64c1...@lab.ntt.co.jp

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/24fd674a1affe1ca9776bd6b21b2b35feb0fe6ed

Modified Files
--
src/backend/optimizer/README | 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: Fix misplaced ReleaseSysCache call in get_default_partition_oid.

2017-10-28 Thread Robert Haas
Fix misplaced ReleaseSysCache call in get_default_partition_oid.

Julien Rouhaud

Discussion: 
http://postgr.es/m/caobau_y4omla+vbsvda-jwblojwipxfdkckmjrzm7nmzxa1...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/1310ac258c773ab9d41650b509098dd01cb4ecf3

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: Allow parallel query for prepared statements with generic plans.

2017-10-27 Thread Robert Haas
Allow parallel query for prepared statements with generic plans.

This was always intended to work, but due to an oversight in
max_parallel_hazard_walker, it didn't.  In testing, we missed the
fact that it was only working for custom plans, where the parameter
value has been substituted for the parameter itself early enough
that everything worked.  In a generic plan, the Param node survives
and must be treated as parallel-safe.  SerializeParamList provides
for the transmission of parameter values to workers.

Amit Kapila with help from Kuntal Ghosh.  Some changes by me.

Discussion: 
http://postgr.es/m/caa4ek1+_buzrmvceua5eqnm4co9daxdm5hpaoe2j19epbr9...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/682ce911f8f30de39b13cf211fc8ceb8c6cbc01b

Modified Files
--
src/backend/optimizer/util/clauses.c  |  8 ++--
src/pl/plpgsql/src/pl_exec.c  | 10 +-
src/test/regress/expected/select_parallel.out | 20 
src/test/regress/sql/select_parallel.sql  |  6 ++
4 files changed, 37 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


[COMMITTERS] pgsql: Move new structure member to the end.

2017-10-27 Thread Robert Haas
Move new structure member to the end.

Reduces ABI breakage.  Per Tom Lane.

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

Branch
--
REL_10_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/69fc2ca4ccdc70c6f9bd7909a771b0983017cb5c

Modified Files
--
src/include/nodes/execnodes.h | 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: Revert "Move new structure member to the end."

2017-10-27 Thread Robert Haas
Revert "Move new structure member to the end."

This reverts commit 94d622f27be6d48e61a68496da4f2efb06fe8746.  That
commit was supposed to get pushed to REL_10_STABLE, but I messed
up.

Branch
--
master

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

Modified Files
--
src/include/nodes/execnodes.h | 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


Re: [COMMITTERS] pgsql: Move new structure member to the end.

2017-10-27 Thread Robert Haas
On Fri, Oct 27, 2017 at 4:48 PM, Tom Lane <t...@sss.pgh.pa.us> wrote:
> Robert Haas <rh...@postgresql.org> writes:
>> Move new structure member to the end.
>> Reduces ABI breakage.  Per Tom Lane.
>
>> Branch
>> --
>> master
>
> Uh, no.  I wasn't complaining that you made this change in master;
> it's fine there.  Where it's not fine is REL_10_STABLE.

Yeah, I fat-fingered that.  Sorry.  Will fix.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
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: Move new structure member to the end.

2017-10-27 Thread Robert Haas
Move new structure member to the end.

Reduces ABI breakage.  Per Tom Lane.

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

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/94d622f27be6d48e61a68496da4f2efb06fe8746

Modified Files
--
src/include/nodes/execnodes.h | 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: Fix mistaken failure to allow parallelism in corner case.

2017-10-27 Thread Robert Haas
Fix mistaken failure to allow parallelism in corner case.

If we try to run a parallel plan in serial mode because, for example,
it's going to be scanned via a cursor, but for some reason we're
already in parallel mode (for example because an outer query is
running in parallel), we'd incorrectly try to launch workers.
Fix by adding a flag to the EState, so that we can be certain that
ExecutePlan() and ExecGather()/ExecGatherMerge() will have the same
idea about whether we are executing serially or in parallel.

Report and fix by Amit Kapila with help from Kuntal Ghosh.  A few
tweaks by me.

Discussion: 
http://postgr.es/m/caa4ek1+_buzrmvceua5eqnm4co9daxdm5hpaoe2j19epbr9...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/639c1a6bb9ee08fe4757a6fab1ddbd01291515e1

Modified Files
--
src/backend/executor/execMain.c| 1 +
src/backend/executor/execUtils.c   | 2 ++
src/backend/executor/nodeGather.c  | 2 +-
src/backend/executor/nodeGatherMerge.c | 2 +-
src/include/nodes/execnodes.h  | 2 ++
5 files changed, 7 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: Fix mistaken failure to allow parallelism in corner case.

2017-10-27 Thread Robert Haas
Fix mistaken failure to allow parallelism in corner case.

If we try to run a parallel plan in serial mode because, for example,
it's going to be scanned via a cursor, but for some reason we're
already in parallel mode (for example because an outer query is
running in parallel), we'd incorrectly try to launch workers.
Fix by adding a flag to the EState, so that we can be certain that
ExecutePlan() and ExecGather()/ExecGatherMerge() will have the same
idea about whether we are executing serially or in parallel.

Report and fix by Amit Kapila with help from Kuntal Ghosh.  A few
tweaks by me.

Discussion: 
http://postgr.es/m/caa4ek1+_buzrmvceua5eqnm4co9daxdm5hpaoe2j19epbr9...@mail.gmail.com

Branch
--
REL9_6_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/036b6bd50365b9ae6ec0b4cb21d172510ef440a9

Modified Files
--
src/backend/executor/execMain.c   | 5 +
src/backend/executor/execUtils.c  | 2 ++
src/backend/executor/nodeGather.c | 2 +-
src/include/nodes/execnodes.h | 2 ++
4 files changed, 6 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 mistaken failure to allow parallelism in corner case.

2017-10-27 Thread Robert Haas
Fix mistaken failure to allow parallelism in corner case.

If we try to run a parallel plan in serial mode because, for example,
it's going to be scanned via a cursor, but for some reason we're
already in parallel mode (for example because an outer query is
running in parallel), we'd incorrectly try to launch workers.
Fix by adding a flag to the EState, so that we can be certain that
ExecutePlan() and ExecGather()/ExecGatherMerge() will have the same
idea about whether we are executing serially or in parallel.

Report and fix by Amit Kapila with help from Kuntal Ghosh.  A few
tweaks by me.

Discussion: 
http://postgr.es/m/caa4ek1+_buzrmvceua5eqnm4co9daxdm5hpaoe2j19epbr9...@mail.gmail.com

Branch
--
REL_10_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/965a16fa9f8c316c30f4ada3c1c98b5dd4666f25

Modified Files
--
src/backend/executor/execMain.c| 1 +
src/backend/executor/execUtils.c   | 2 ++
src/backend/executor/nodeGather.c  | 2 +-
src/backend/executor/nodeGatherMerge.c | 2 +-
src/include/nodes/execnodes.h  | 2 ++
5 files changed, 7 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: In relevant log messages, indicate whether vacuums are aggressiv

2017-10-26 Thread Robert Haas
In relevant log messages, indicate whether vacuums are aggressive.

Kyotaro Horiguchi, reviewed Masahiko Sawada, David G. Johnston, Álvaro
Herrera, and me.  Grammar correction to the final posted patch by me.

Discussion: 
http://postgr.es/m/20170329.124649.193656100.horiguchi.kyot...@lab.ntt.co.jp

Branch
--
master

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

Modified Files
--
src/backend/commands/vacuumlazy.c | 21 -
1 file changed, 16 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: pg_stat_statements: Add a comment about the dangers of padding b

2017-10-20 Thread Robert Haas
pg_stat_statements: Add a comment about the dangers of padding bytes.

Inspired by a patch from Julien Rouhaud, but I reworded it.

Discussion: 
http://postgr.es/m/CAOBaU_a8AH8=ypfqgHnDYu06ts+jWTUgh=vgcxa3ynv-k10...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/2959213bf33cf7d2d1fc0b46c67d36254ffe043f

Modified Files
--
contrib/pg_stat_statements/pg_stat_statements.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: Fix possible crash with Parallel Bitmap Heap Scan.

2017-10-13 Thread Robert Haas
Fix possible crash with Parallel Bitmap Heap Scan.

If a Parallel Bitmap Heap scan's chain of leftmost descendents
includes a BitmapOr whose first child is a BitmapAnd, the prior coding
would mistakenly create a non-shared TIDBitmap and then try to perform
shared iteration.

Report by Tomas Vondra.  Patch by Dilip Kumar.

Discussion: 
http://postgr.es/m/50e89684-8ad9-dead-8767-c9545bafd...@2ndquadrant.com

Branch
--
REL_10_STABLE

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

Modified Files
--
src/backend/optimizer/plan/createplan.c | 4 
1 file changed, 4 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: Fix possible crash with Parallel Bitmap Heap Scan.

2017-10-13 Thread Robert Haas
Fix possible crash with Parallel Bitmap Heap Scan.

If a Parallel Bitmap Heap scan's chain of leftmost descendents
includes a BitmapOr whose first child is a BitmapAnd, the prior coding
would mistakenly create a non-shared TIDBitmap and then try to perform
shared iteration.

Report by Tomas Vondra.  Patch by Dilip Kumar.

Discussion: 
http://postgr.es/m/50e89684-8ad9-dead-8767-c9545bafd...@2ndquadrant.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/6393613b6a1e0feae3d22af608397b252cee5b58

Modified Files
--
src/backend/optimizer/plan/createplan.c | 4 
1 file changed, 4 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: Avoid coercing a whole-row variable that is already coerced.

2017-10-12 Thread Robert Haas
Avoid coercing a whole-row variable that is already coerced.

Marginal efficiency and beautification hack.  I'm not sure whether
this case ever arises currently, but the pending patch for update
tuple routing will cause it to arise.

Amit Khandekar

Discussion: 
http://postgr.es/m/caj3gd9cazfppe7-wwubabpcq4_0subkipfd1+0r5_dkvnwo...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/1c497fa72df7593d8976653538da3d0ab033207f

Modified Files
--
src/backend/rewrite/rewriteManip.c | 53 ++
1 file changed, 42 insertions(+), 11 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: Use ResultRelInfo ** rather than ResultRelInfo * for tuple routi

2017-10-12 Thread Robert Haas
Use ResultRelInfo ** rather than ResultRelInfo * for tuple routing.

The previous convention doesn't lend itself to creating ResultRelInfos
lazily, as we already do in ExecGetTriggerResultRel.  This patch
doesn't make anything lazier than before, but the pending patch for
UPDATE tuple routing proposes to do so (and there might be other
opportunities as well).

Amit Khandekar with some adjustments by me.

Discussion: 
http://postgr.es/m/ca+tgmoypvp9lyf6vufa5dwxs4c--x6loj2y36bsjaytp62e...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/60f7c0abef0327648c02795312d1679c66586fbb

Modified Files
--
src/backend/commands/copy.c| 10 ++---
src/backend/executor/execMain.c| 13 +++---
src/backend/executor/nodeModifyTable.c | 74 --
src/include/executor/executor.h|  2 +-
src/include/nodes/execnodes.h  |  2 +-
5 files changed, 57 insertions(+), 44 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: Synchronize error messages.

2017-10-12 Thread Robert Haas
Synchronize error messages.

Commits 6476b26115f3ef25a9cd87880e0ac5ec5f7a05f6
and 14f67a8ee282ebc0de78e773fbd597f460ab4a54 didn't use quite the
same error message for what is basically the same situation.

Amit Langote, pared back a bit by me.

Discussion: 
http://postgr.es/m/54dc76d0-3b5b-ba5a-27dc-fb31a3975...@lab.ntt.co.jp

Branch
--
master

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

Modified Files
--
src/backend/catalog/partition.c   | 4 ++--
src/test/regress/expected/alter_table.out | 4 ++--
2 files 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: Fix logical replication to fire BEFORE ROW DELETE triggers.

2017-10-12 Thread Robert Haas
Fix logical replication to fire BEFORE ROW DELETE triggers.

Before, that would fail to happen unless a BEFORE ROW UPDATE trigger
was also present.

Noted by me while reviewing a patch from Masahiko Sawada, who also
wrote this patch.  Reviewed by Petr Jelinek.

Discussion: 
http://postgr.es/m/ca+tgmobazvcxdug8y_mqkbk7nz-vhbdlvjm354kefozpuzm...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/360fd1a7b2fe779cc9e696b813b12f6a8e83b558

Modified Files
--
src/backend/executor/execReplication.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 logical replication to fire BEFORE ROW DELETE triggers.

2017-10-12 Thread Robert Haas
Fix logical replication to fire BEFORE ROW DELETE triggers.

Before, that would fail to happen unless a BEFORE ROW UPDATE trigger
was also present.

Noted by me while reviewing a patch from Masahiko Sawada, who also
wrote this patch.  Reviewed by Petr Jelinek.

Discussion: 
http://postgr.es/m/ca+tgmobazvcxdug8y_mqkbk7nz-vhbdlvjm354kefozpuzm...@mail.gmail.com

Branch
--
REL_10_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/7cde649ab150412344ee50fc90f24d6fe891bcf0

Modified Files
--
src/backend/executor/execReplication.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: pg_stat_statements: Widen query IDs from 32 bits to 64 bits.

2017-10-11 Thread Robert Haas
pg_stat_statements: Widen query IDs from 32 bits to 64 bits.

This takes advantage of the infrastructure introduced by commit
81c5e46c490e2426db243eada186995da5bb0ba7 to greatly reduce the
likelihood that two different queries will end up with the same query
ID.  It's still possible, of course, but whereas before it the chances
of a collision reached 25% around 50,000 queries, it will now take
more than 3 billion queries.

Backward incompatibility: Because the type exposed at the SQL level is
int8, users may now see negative query IDs in the pg_stat_statements
view (and also, query IDs more than 4 billion, which was the old
limit).

Patch by me, reviewed by Michael Paquier and Peter Geoghegan.

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

Branch
--
master

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

Modified Files
--
contrib/pg_stat_statements/pg_stat_statements.c | 76 -
src/backend/executor/execParallel.c |  2 +-
src/backend/nodes/outfuncs.c|  7 ++-
src/backend/nodes/readfuncs.c   | 11 +++-
src/backend/rewrite/rewriteHandler.c|  2 +-
src/include/nodes/parsenodes.h  |  2 +-
src/include/nodes/plannodes.h   |  2 +-
7 files changed, 42 insertions(+), 60 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 mistakes in comments.

2017-10-11 Thread Robert Haas
Fix mistakes in comments.

Masahiko Sawada

Discussion: 
http://postgr.es/m/cad21aobsfysmhd6_sl9in3n_foaa+opbl5jg55dxu1chauj...@mail.gmail.com

Branch
--
REL_10_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/516e29ab6f1f66767a78361dea0392f1530766b6

Modified Files
--
src/backend/executor/execReplication.c | 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: Fix mistakes in comments.

2017-10-11 Thread Robert Haas
Fix mistakes in comments.

Masahiko Sawada

Discussion: 
http://postgr.es/m/cad21aobsfysmhd6_sl9in3n_foaa+opbl5jg55dxu1chauj...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/20d210bf5bb0d5ae37c727d364cfd810c367704a

Modified Files
--
src/backend/executor/execReplication.c | 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: Copy information from the relcache instead of pointing to it.

2017-10-06 Thread Robert Haas
Copy information from the relcache instead of pointing to it.

We have the relations continuously locked, but not open, so relcache
pointers are not guaranteed to be stable.  Per buildfarm member
prion.

Ashutosh Bapat.  I fixed a typo.

Discussion: 
http://postgr.es/m/CAFjFpRcRBqoKLZSNmRsjKr81uEP=ennvqsqaxvccbtxvj2r...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/45866c75507f0757de0da6e90c694a0dbe67d727

Modified Files
--
src/backend/catalog/partition.c  | 68 
src/backend/optimizer/util/plancat.c | 35 ++-
src/include/catalog/partition.h  |  2 ++
3 files changed, 96 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


Re: [COMMITTERS] pgsql: Basic partition-wise join functionality.

2017-10-06 Thread Robert Haas
On Fri, Oct 6, 2017 at 12:47 PM, Tom Lane <t...@sss.pgh.pa.us> wrote:
> Robert Haas <rh...@postgresql.org> writes:
>> Basic partition-wise join functionality.
>
> Buildfarm member prion seems quite unhappy with this.
>
> I'm not sure if that's a case of the plan choices being less
> platform-independent than you thought, or if it's triggered by the
> -DRELCACHE_FORCE_RELEASE option, in which case there's an actual bug
> here and not just poorly chosen test cases.

It's the bug one.  Ashutosh pinged me off-list and he's working on it.
Somehow I thought it was OK for the planner to have pointers into the
relcache, but apparently we don't keep the relations open throughout
planning, only locked. So set_relation_partition_info and
find_partition_scheme needs to grow code to copy stuff instead of just
pointing to it.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
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: Basic partition-wise join functionality.

2017-10-06 Thread Robert Haas
Basic partition-wise join functionality.

Instead of joining two partitioned tables in their entirety we can, if
it is an equi-join on the partition keys, join the matching partitions
individually.  This involves teaching the planner about "other join"
rels, which are related to regular join rels in the same way that
other member rels are related to baserels.  This can use significantly
more CPU time and memory than regular join planning, because there may
now be a set of "other" rels not only for every base relation but also
for every join relation.  In most practical cases, this probably
shouldn't be a problem, because (1) it's probably unusual to join many
tables each with many partitions using the partition keys for all
joins and (2) if you do that scenario then you probably have a big
enough machine to handle the increased memory cost of planning and (3)
the resulting plan is highly likely to be better, so what you spend in
planning you'll make up on the execution side.  All the same, for now,
turn this feature off by default.

Currently, we can only perform joins between two tables whose
partitioning schemes are absolutely identical.  It would be nice to
cope with other scenarios, such as extra partitions on one side or the
other with no match on the other side, but that will have to wait for
a future patch.

Ashutosh Bapat, reviewed and tested by Rajkumar Raghuwanshi, Amit
Langote, Rafia Sabih, Thomas Munro, Dilip Kumar, Antonin Houska, Amit
Khandekar, and by me.  A few final adjustments by me.

Discussion: 
http://postgr.es/m/CAFjFpRfQ8GrQvzp3jA2wnLqrHmaXna-urjm_UY9BqXj=ead...@mail.gmail.com
Discussion: 
http://postgr.es/m/cafjfprcitjfrulr5jfukwrpsgux0lq0k8-yg0qw2+1lbgnp...@mail.gmail.com

Branch
--
master

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

Modified Files
--
contrib/postgres_fdw/expected/postgres_fdw.out |  120 ++
contrib/postgres_fdw/sql/postgres_fdw.sql  |   53 +
doc/src/sgml/config.sgml   |   20 +
doc/src/sgml/fdwhandler.sgml   |   20 +
src/backend/optimizer/README   |   26 +
src/backend/optimizer/geqo/geqo_eval.c |3 +
src/backend/optimizer/path/allpaths.c  |  268 +++-
src/backend/optimizer/path/costsize.c  |1 +
src/backend/optimizer/path/joinpath.c  |  102 +-
src/backend/optimizer/path/joinrels.c  |  316 -
src/backend/optimizer/plan/createplan.c|   35 +-
src/backend/optimizer/plan/planner.c   |   22 +
src/backend/optimizer/plan/setrefs.c   |   58 +-
src/backend/optimizer/prep/prepunion.c |   95 ++
src/backend/optimizer/util/pathnode.c  |  363 +
src/backend/optimizer/util/placeholder.c   |   58 +
src/backend/optimizer/util/plancat.c   |   32 +-
src/backend/optimizer/util/relnode.c   |  368 -
src/backend/utils/misc/guc.c   |9 +
src/backend/utils/misc/postgresql.conf.sample  |1 +
src/include/foreign/fdwapi.h   |6 +
src/include/nodes/extensible.h |3 +
src/include/nodes/relation.h   |   50 +-
src/include/optimizer/cost.h   |1 +
src/include/optimizer/pathnode.h   |6 +
src/include/optimizer/paths.h  |5 +
src/include/optimizer/placeholder.h|2 +
src/include/optimizer/planner.h|2 +
src/include/optimizer/prep.h   |6 +
src/test/regress/expected/partition_join.out   | 1789 
src/test/regress/expected/sysviews.out |   31 +-
src/test/regress/parallel_schedule |3 +-
src/test/regress/serial_schedule   |1 +
src/test/regress/sql/partition_join.sql|  354 +
34 files changed, 4089 insertions(+), 140 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: On CREATE TABLE, consider skipping validation of subpartitions.

2017-10-05 Thread Robert Haas
On CREATE TABLE, consider skipping validation of subpartitions.

This is just like commit 14f67a8ee282ebc0de78e773fbd597f460ab4a54, but
for CREATE PARTITION rather than ATTACH PARTITION.

Jeevan Ladhe, with test case changes by me.

Discussion: 
http://postgr.es/m/CAOgcT0MWwG8WBw8frFMtRYHAgDD=tpt6u7wcso_l2k0kypm...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/6476b26115f3ef25a9cd87880e0ac5ec5f7a05f6

Modified Files
--
src/backend/catalog/partition.c   | 18 ++
src/test/regress/expected/alter_table.out | 12 +---
src/test/regress/sql/alter_table.sql  | 11 ---
3 files changed, 35 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


[COMMITTERS] pgsql: Improve error message when skipping scan of default partition.

2017-10-05 Thread Robert Haas
Improve error message when skipping scan of default partition.

It seems like a good idea to clearly distinguish between skipping the
scan of the new partition itself and skipping the scan of the default
partition.

Amit Langote

Discussion: 
http://postgr.es/m/1f08b844-0078-aa8d-452e-7af3bf77d...@lab.ntt.co.jp

Branch
--
master

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

Modified Files
--
src/backend/commands/tablecmds.c  | 11 ---
src/test/regress/expected/alter_table.out |  4 ++--
2 files changed, 10 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: On attach, consider skipping validation of subpartitions individ

2017-10-05 Thread Robert Haas
On attach, consider skipping validation of subpartitions individually.

If the table attached as a partition is itself partitioned, individual
partitions might have constraints strong enough to skip scanning the
table even if the table actually attached does not.  This is pretty
cheap to check, and possibly a big win if it works out.

Amit Langote, with test case changes by me.

Discussion: 
http://postgr.es/m/1f08b844-0078-aa8d-452e-7af3bf77d...@lab.ntt.co.jp

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/14f67a8ee282ebc0de78e773fbd597f460ab4a54

Modified Files
--
src/backend/commands/tablecmds.c  | 15 +++
src/test/regress/expected/alter_table.out | 14 ++
src/test/regress/sql/alter_table.sql  | 14 ++
3 files changed, 43 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: Allow DML commands that create tables to use parallel query.

2017-10-05 Thread Robert Haas
Allow DML commands that create tables to use parallel query.

Haribabu Kommi, reviewed by Dilip Kumar and Rafia Sabih.  Various
cosmetic changes by me to explain why this appears to be safe but
allowing inserts in parallel mode in general wouldn't be.  Also, I
removed the REFRESH MATERIALIZED VIEW case from Haribabu's patch,
since I'm not convinced that case is OK, and hacked on the
documentation somewhat.

Discussion: 
http://postgr.es/m/cajrrpgdo5bak6qnpwe8kpi8g_jfqes-g4symg9y+ofaw2-d...@mail.gmail.com

Branch
--
master

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

Modified Files
--
doc/src/sgml/parallel.sgml   | 16 ++
src/backend/access/heap/heapam.c | 16 +++---
src/backend/commands/createas.c  |  4 +-
src/backend/commands/explain.c   |  4 +-
src/backend/executor/execMain.c  |  6 +--
src/backend/optimizer/plan/planner.c | 10 
src/test/regress/expected/write_parallel.out | 79 
src/test/regress/parallel_schedule   |  1 +
src/test/regress/serial_schedule |  1 +
src/test/regress/sql/write_parallel.sql  | 42 +++
10 files changed, 151 insertions(+), 28 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 typo.

2017-10-05 Thread Robert Haas
Fix typo.

Etsuro Fujita

Discussion: 
http://postgr.es/m/1b2e9ac7-b99a-2769-5e42-afdf62bfa...@lab.ntt.co.jp

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/4b2ba1fe0222b7820a2f4cd52b133baeb91c5a93

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: Fix more user-visible elog() calls.

2017-10-05 Thread Robert Haas
Fix more user-visible elog() calls.

Michael Paquier discovered that this could be triggered via SQL;
give a nicer message instead.

Patch by Michael Paquier, reviewed by Masahiko Sawada.

Discussion: 
http://postgr.es/m/cab7npqqtpg+lkktzdkn26judhcvpz0s1gnigzot4j8cyuuu...@mail.gmail.com

Branch
--
REL_10_STABLE

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

Modified Files
--
contrib/test_decoding/expected/replorigin.out |  9 -
contrib/test_decoding/sql/replorigin.sql  |  5 +
src/backend/replication/logical/origin.c  | 12 
3 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: Fix more user-visible elog() calls.

2017-10-05 Thread Robert Haas
Fix more user-visible elog() calls.

Michael Paquier discovered that this could be triggered via SQL;
give a nicer message instead.

Patch by Michael Paquier, reviewed by Masahiko Sawada.

Discussion: 
http://postgr.es/m/cab7npqqtpg+lkktzdkn26judhcvpz0s1gnigzot4j8cyuuu...@mail.gmail.com

Branch
--
master

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

Modified Files
--
contrib/test_decoding/expected/replorigin.out |  9 -
contrib/test_decoding/sql/replorigin.sql  |  5 +
src/backend/replication/logical/origin.c  | 12 
3 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: Fix more user-visible elog() calls.

2017-10-05 Thread Robert Haas
Fix more user-visible elog() calls.

Michael Paquier discovered that this could be triggered via SQL;
give a nicer message instead.

Patch by Michael Paquier, reviewed by Masahiko Sawada.

Discussion: 
http://postgr.es/m/cab7npqqtpg+lkktzdkn26judhcvpz0s1gnigzot4j8cyuuu...@mail.gmail.com

Branch
--
REL9_6_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/9d742e19da22aca5f872ccb07b1b8abe78de23dd

Modified Files
--
contrib/test_decoding/expected/replorigin.out |  9 -
contrib/test_decoding/sql/replorigin.sql  |  5 +
src/backend/replication/logical/origin.c  | 12 
3 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: Fix more user-visible elog() calls.

2017-10-05 Thread Robert Haas
Fix more user-visible elog() calls.

Michael Paquier discovered that this could be triggered via SQL;
give a nicer message instead.

Patch by Michael Paquier, reviewed by Masahiko Sawada.

Discussion: 
http://postgr.es/m/cab7npqqtpg+lkktzdkn26judhcvpz0s1gnigzot4j8cyuuu...@mail.gmail.com

Branch
--
REL9_5_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/32022e3f55eab593bcd829341216810730911d51

Modified Files
--
contrib/test_decoding/expected/replorigin.out |  9 -
contrib/test_decoding/sql/replorigin.sql  |  5 +
src/backend/replication/logical/origin.c  | 12 
3 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: psql: Don't try to print a partition constraint we didn't fetch.

2017-09-29 Thread Robert Haas
psql: Don't try to print a partition constraint we didn't fetch.

If \d rather than \d+ is used, then verbose is false and we don't ask
the server for the partition constraint; so we shouldn't print it in
that case either.

Maksim Milyutin, per a report from Jesper Pedersen.  Reviewed by
Jesper Pedersen and Amit Langote.

Discussion: http://postgr.es/m/2af5fc4d-7bcc-daa8-4fe6-86274bea3...@redhat.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/69c16983e103f913ee0dae7f288611de006ba2ba

Modified Files
--
src/bin/psql/describe.c | 17 ++---
1 file changed, 10 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


[COMMITTERS] pgsql: pgbench: If we fail to send a command to the server, fail.

2017-09-29 Thread Robert Haas
pgbench: If we fail to send a command to the server, fail.

This beats the old behavior of busy-waiting hands down.

Oversight in commit 12788ae49e1933f463bc59a6efe46c4a01701b76.

Report by Pavan Deolasee. Patch by Fabien Coelho.  Reviewed by
Pavan Deolasee.

Discussion: 
http://postgr.es/m/CABOikdPhfXTypckMC1Ux6Ko+hKBWwUBA=exsvamxysg8m9j...@mail.gmail.com

Branch
--
REL_10_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/434146d21666dd2023705fb26582918212e124d1

Modified Files
--
src/bin/pgbench/pgbench.c | 8 ++--
1 file changed, 2 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


[COMMITTERS] pgsql: pgbench: If we fail to send a command to the server, fail.

2017-09-29 Thread Robert Haas
pgbench: If we fail to send a command to the server, fail.

This beats the old behavior of busy-waiting hands down.

Oversight in commit 12788ae49e1933f463bc59a6efe46c4a01701b76.

Report by Pavan Deolasee. Patch by Fabien Coelho.  Reviewed by
Pavan Deolasee.

Discussion: 
http://postgr.es/m/CABOikdPhfXTypckMC1Ux6Ko+hKBWwUBA=exsvamxysg8m9j...@mail.gmail.com

Branch
--
master

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

Modified Files
--
src/bin/pgbench/pgbench.c | 8 ++--
1 file changed, 2 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


[COMMITTERS] pgsql: Remove replacement selection sort.

2017-09-29 Thread Robert Haas
Remove replacement selection sort.

At the time replacement_sort_tuples was introduced, there were still
cases where replacement selection sort noticeably outperformed using
quicksort even for the first run.  However, those cases seem to have
evaporated as a result of further improvements made since that time
(and perhaps also advances in CPU technology).  So remove replacement
selection and the controlling GUC entirely.  This makes tuplesort.c
noticeably simpler and probably paves the way for further
optimizations someone might want to do later.

Peter Geoghegan, with review and testing by Tomas Vondra and me.

Discussion: 
https://postgr.es/m/cah2-wzmmnjg_k0r9nqywmq3zjyjjk+hcbizynghay-zyjs6...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/8b304b8b72b0a60f1968d39f01cf817c8df863ec

Modified Files
--
doc/src/sgml/config.sgml  |  39 ---
doc/src/sgml/release-9.6.sgml |   2 +-
src/backend/utils/init/globals.c  |   1 -
src/backend/utils/misc/guc.c  |  10 -
src/backend/utils/misc/postgresql.conf.sample |   1 -
src/backend/utils/sort/tuplesort.c| 415 +++---
src/include/miscadmin.h   |   1 -
src/test/regress/expected/cluster.out |  17 +-
src/test/regress/sql/cluster.sql  |  14 +-
9 files changed, 52 insertions(+), 448 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 lsn from HashScanPosData.

2017-09-26 Thread Robert Haas
Remove lsn from HashScanPosData.

This was intended as infrastructure for weakening VACUUM's locking
requirements, similar to what was done for btree indexes in commit
2ed5b87f96d473962ec5230fd820abfeaccb2069.  However, for hash indexes,
it seems that the improvements which are possible are actually
extremely marginal.  Furthermore, performing the LSN cross-check will
end up skipping cleanup far more often than is necessary; we only care
about page modifications due to a VACUUM, but the LSN check will fail
if ANY modification has occurred.  So, rather than pressing forward
with that "optimization", just rip the LSN field out.

Patch by me, reviewed by Ashutosh Sharma and Amit Kapila

Discussion: 
http://postgr.es/m/CAA4eK1JxqqcuC5Un7YLQVhOYSZBS+t=3xqzuekt5ryquyux...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/22c5e73562c53437979efec4c26cd9fff408777c

Modified Files
--
src/backend/access/hash/hashsearch.c |  8 
src/backend/access/hash/hashutil.c   | 27 +++
src/include/access/hash.h|  2 --
3 files changed, 7 insertions(+), 30 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 trivial mistake in README.

2017-09-26 Thread Robert Haas
Fix trivial mistake in README.

You might think I (Robert) could manage to count to five without
messing it up, but if you did, you would be wrong.

Amit Kapila

Discussion: 
http://postgr.es/m/CAA4eK1JxqqcuC5Un7YLQVhOYSZBS+t=3xqzuekt5ryquyux...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/79a4a665c046af91d4216fe69b535c429039d0d0

Modified Files
--
src/backend/access/hash/README | 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: For wal_consistency_checking, mask page checksum as well as page

2017-09-22 Thread Robert Haas
For wal_consistency_checking, mask page checksum as well as page LSN.

If the LSN is different, the checksum will be different, too.

Ashwin Agrawal, reviewed by Michael Paquier and Kuntal Ghosh

Discussion: 
http://postgr.es/m/CALfoeis5iqrAU-+JAN+ZzXkpPr7+-0OAGv7QUHwFn=-wdy4...@mail.gmail.com

Branch
--
REL_10_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/1a44df007c9b9adc5e6082fc90fe68e615d38ecd

Modified Files
--
src/backend/access/brin/brin_xlog.c   | 2 +-
src/backend/access/common/bufmask.c   | 8 +---
src/backend/access/gin/ginxlog.c  | 2 +-
src/backend/access/gist/gistxlog.c| 4 ++--
src/backend/access/hash/hash_xlog.c   | 2 +-
src/backend/access/heap/heapam.c  | 2 +-
src/backend/access/nbtree/nbtxlog.c   | 2 +-
src/backend/access/spgist/spgxlog.c   | 2 +-
src/backend/access/transam/generic_xlog.c | 2 +-
src/backend/commands/sequence.c   | 2 +-
src/include/access/bufmask.h  | 2 +-
11 files changed, 16 insertions(+), 14 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: For wal_consistency_checking, mask page checksum as well as page

2017-09-22 Thread Robert Haas
For wal_consistency_checking, mask page checksum as well as page LSN.

If the LSN is different, the checksum will be different, too.

Ashwin Agrawal, reviewed by Michael Paquier and Kuntal Ghosh

Discussion: 
http://postgr.es/m/CALfoeis5iqrAU-+JAN+ZzXkpPr7+-0OAGv7QUHwFn=-wdy4...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/6a2fa09c0cba0e5a11854d733872ac18511f4c83

Modified Files
--
src/backend/access/brin/brin_xlog.c   | 2 +-
src/backend/access/common/bufmask.c   | 8 +---
src/backend/access/gin/ginxlog.c  | 2 +-
src/backend/access/gist/gistxlog.c| 4 ++--
src/backend/access/hash/hash_xlog.c   | 2 +-
src/backend/access/heap/heapam.c  | 2 +-
src/backend/access/nbtree/nbtxlog.c   | 2 +-
src/backend/access/spgist/spgxlog.c   | 2 +-
src/backend/access/transam/generic_xlog.c | 2 +-
src/backend/commands/sequence.c   | 2 +-
src/include/access/bufmask.h  | 2 +-
11 files changed, 16 insertions(+), 14 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: hash: Implement page-at-a-time scan.

2017-09-22 Thread Robert Haas
hash: Implement page-at-a-time scan.

Commit 09cb5c0e7d6fbc9dee26dc429e4fc0f2a88e5272 added a similar
optimization to btree back in 2006, but nobody bothered to implement
the same thing for hash indexes, probably because they weren't
WAL-logged and had lots of other performance problems as well.  As
with the corresponding btree case, this eliminates the problem of
potentially needing to refind our position within the page, and cuts
down on pin/unpin traffic as well.

Ashutosh Sharma, reviewed by Alexander Korotkov, Jesper Pedersen,
Amit Kapila, and me.  Some final edits to comments and README by
me.

Discussion: 
http://postgr.es/m/cae9k0pm3ktx93k8_5j6vmzg4h5f+syknxuwxrn-zqsz9x8z...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/7c75ef571579a3ad7a1d3ee909f11dba5e0b9440

Modified Files
--
src/backend/access/hash/README   |  79 +++--
src/backend/access/hash/hash.c   | 165 ++
src/backend/access/hash/hashpage.c   |  10 +-
src/backend/access/hash/hashsearch.c | 569 ++-
src/backend/access/hash/hashutil.c   |  67 -
src/include/access/hash.h|  70 -
6 files changed, 562 insertions(+), 398 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: Associate partitioning information with each RelOptInfo.

2017-09-20 Thread Robert Haas
Associate partitioning information with each RelOptInfo.

This is not used for anything yet, but it is necessary infrastructure
for partition-wise join and for partition pruning without constraint
exclusion.

Ashutosh Bapat, reviewed by Amit Langote and with quite a few changes,
mostly cosmetic, by me.  Additional review and testing of this patch
series by Antonin Houska, Amit Khandekar, Rafia Sabih, Rajkumar
Raghuwanshi, Thomas Munro, and Dilip Kumar.

Discussion: 
http://postgr.es/m/cafjfprfnefg3h+f6baixemmrkf+fy-popx3ocy+rih3ybmx...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/9140cf8269b0c4ae002b2748d93979d535891311

Modified Files
--
src/backend/optimizer/util/plancat.c | 159 +++
src/backend/optimizer/util/relnode.c |  37 +++-
src/include/nodes/relation.h |  56 +++-
3 files changed, 249 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 create_lateral_join_info to handle dead relations properly.

2017-09-20 Thread Robert Haas
Fix create_lateral_join_info to handle dead relations properly.

Commit 0a480502b092195a9b25a2f0f199a21d592a9c57 broke it.

Report by Andreas Seltenreich.  Fix by Ashutosh Bapat.

Discussion: http://postgr.es/m/874ls2vrnx@ansel.ydns.eu

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/57eebca03a9eb61eb18f8ea9db94775653f797d1

Modified Files
--
src/backend/optimizer/plan/initsplan.c |  7 +--
src/test/regress/expected/join.out | 12 
src/test/regress/sql/join.sql  |  5 +
3 files changed, 22 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: Set partitioned_rels appropriately when UNION ALL is used.

2017-09-20 Thread Robert Haas
On Tue, Sep 19, 2017 at 7:59 PM, Thomas Munro
<thomas.mu...@enterprisedb.com> wrote:
> I spotted a typo: s/unexpcted/unexpected/.

Thnks!  Commmitted yur paatch.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Compny


-- 
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 typo.

2017-09-20 Thread Robert Haas
Fix typo.

Thomas Munro

Discussion: 
http://postgr.es/m/CAEepm=2j-hagnburaazws0ry7z_ihk+d7g+ye3u99+6wbig...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/7f3a3312abf34ea7e899046e326775612802764b

Modified Files
--
src/backend/optimizer/path/allpaths.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: Avoid use of non-portable strnlen() in pgstat_clip_activity().

2017-09-19 Thread Robert Haas
On Tue, Sep 19, 2017 at 5:27 PM, Andres Freund <and...@anarazel.de> wrote:
> Avoid use of non-portable strnlen() in pgstat_clip_activity().
>
> The use of strnlen rather than strlen was just paranoia. Instead of
> giving up on the paranoia, just implement the safeguard
> differently. And add a comment explaining why we're careful.
>
> Author: Andres Freund
> Discussion: https://postgr.es/m/e1duokj-0001mc...@gemulon.postgresql.org

I think it should say a NUL byte or a \0 byte, not a NULL byte.  NULL
is a pointer value.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
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: After a MINVALUE/MAXVALUE bound, allow only more of the same.

2017-09-15 Thread Robert Haas
After a MINVALUE/MAXVALUE bound, allow only more of the same.

In the old syntax, which used UNBOUNDED, we had a similar restriction,
but commit d363d42bb9a4399a0207bd3b371c966e22e06bd3, which changed the
syntax, eliminated it.  Put it back.

Patch by me, reviewed by Dean Rasheed.

Discussion: 
http://postgr.es/m/ca+tgmobs+plpc27ts3gopeaxaffhrq5w509cvkwtf9pf6cw...@mail.gmail.com

Branch
--
REL_10_STABLE

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

Modified Files
--
doc/src/sgml/ref/create_table.sgml | 11 ---
src/backend/parser/parse_utilcmd.c | 48 ++
src/test/regress/expected/create_table.out | 12 
src/test/regress/expected/inherit.out  |  4 +--
src/test/regress/expected/insert.out   | 35 +++---
src/test/regress/sql/create_table.sql  |  6 ++--
src/test/regress/sql/inherit.sql   |  4 +--
src/test/regress/sql/insert.sql| 19 +++-
8 files changed, 102 insertions(+), 37 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: After a MINVALUE/MAXVALUE bound, allow only more of the same.

2017-09-15 Thread Robert Haas
After a MINVALUE/MAXVALUE bound, allow only more of the same.

In the old syntax, which used UNBOUNDED, we had a similar restriction,
but commit d363d42bb9a4399a0207bd3b371c966e22e06bd3, which changed the
syntax, eliminated it.  Put it back.

Patch by me, reviewed by Dean Rasheed.

Discussion: 
http://postgr.es/m/ca+tgmobs+plpc27ts3gopeaxaffhrq5w509cvkwtf9pf6cw...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/9361f6f54e3ff9bab84e80d4b1e15be79b48d60e

Modified Files
--
doc/src/sgml/ref/create_table.sgml | 11 ---
src/backend/parser/parse_utilcmd.c | 48 ++
src/test/regress/expected/create_table.out | 12 
src/test/regress/expected/inherit.out  |  4 +--
src/test/regress/expected/insert.out   | 35 +++---
src/test/regress/sql/create_table.sql  |  6 ++--
src/test/regress/sql/inherit.sql   |  4 +--
src/test/regress/sql/insert.sql| 19 +++-
8 files changed, 102 insertions(+), 37 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: Test coverage for CREATE/ALTER FOREIGN DATA WRAPPER .. HANDLER.

2017-09-15 Thread Robert Haas
Test coverage for CREATE/ALTER FOREIGN DATA WRAPPER .. HANDLER.

Amit Langote, per a suggestion from Mark Dilger.  Reviewed by
Marc Dilger and Ashutosh Bapat.

Discussion: 
http://postgr.es/m/cafjfprel0oen7scpnsepbqjhb2bp1wnh1uvbof_w6keuv6z...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/60cd2f8a2d1a1e763b2df015e2e660caa9e39a67

Modified Files
--
src/test/regress/expected/foreign_data.out   | 28 +++-
src/test/regress/input/create_function_1.source  |  6 +
src/test/regress/output/create_function_1.source |  5 +
src/test/regress/regress.c   |  7 ++
src/test/regress/sql/foreign_data.sql| 13 +++
5 files changed, 53 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


[COMMITTERS] pgsql: Add missing tags to GetCommandLogLevel.

2017-09-14 Thread Robert Haas
Add missing tags to GetCommandLogLevel.

Otherwise, log_statement = 'ddl' causes errors if those statement
types are used.

Michael Paquier, reviewed by Ashutosh Sharma

Discussion: 
http://postgr.es/m/cab7npqstc3hke76q1mnhsvd1vf1td9zxapzyadzdmylmrkk...@mail.gmail.com

Branch
--
REL_10_STABLE

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

Modified Files
--
src/backend/tcop/utility.c | 12 
1 file changed, 12 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 missing tags to GetCommandLogLevel.

2017-09-14 Thread Robert Haas
Add missing tags to GetCommandLogLevel.

Otherwise, log_statement = 'ddl' causes errors if those statement
types are used.

Michael Paquier, reviewed by Ashutosh Sharma

Discussion: 
http://postgr.es/m/cab7npqstc3hke76q1mnhsvd1vf1td9zxapzyadzdmylmrkk...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/81276fdd3931d286e62b86b2512a517de2ba2de8

Modified Files
--
src/backend/tcop/utility.c | 12 
1 file changed, 12 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 missing tags to GetCommandLogLevel.

2017-09-14 Thread Robert Haas
Add missing tags to GetCommandLogLevel.

Otherwise, log_statement = 'ddl' causes errors if those statement
types are used.

Michael Paquier, reviewed by Ashutosh Sharma

Discussion: 
http://postgr.es/m/cab7npqstc3hke76q1mnhsvd1vf1td9zxapzyadzdmylmrkk...@mail.gmail.com

Branch
--
REL9_6_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/353328ad1afd14211e8f19c03aba19f2804f48ae

Modified Files
--
src/backend/tcop/utility.c | 4 
1 file changed, 4 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: Expand partitioned table RTEs level by level, without flattening

2017-09-14 Thread Robert Haas
Expand partitioned table RTEs level by level, without flattening.

Flattening the partitioning hierarchy at this stage makes various
desirable optimizations difficult.  The original use case for this
patch was partition-wise join, which wants to match up the partitions
in one partitioning hierarchy with those in another such hierarchy.
However, it now seems that it will also be useful in making partition
pruning work using the PartitionDesc rather than constraint exclusion,
because with a flattened expansion, we have no easy way to figure out
which PartitionDescs apply to which leaf tables in a multi-level
partition hierarchy.

As it turns out, we end up creating both rte->inh and !rte->inh RTEs
for each intermediate partitioned table, just as we previously did for
the root table.  This seems unnecessary since the partitioned tables
have no storage and are not scanned.  We might want to go back and
rejigger things so that no partitioned tables (including the parent)
need !rte->inh RTEs, but that seems to require some adjustments not
related to the core purpose of this patch.

Ashutosh Bapat, reviewed by me and by Amit Langote.  Some final
adjustments by me.

Discussion: 
http://postgr.es/m/CAFjFpRd=1venqLL7oGU=c1dekuvk2djgvf+7ukbnphaum1m...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/0a480502b092195a9b25a2f0f199a21d592a9c57

Modified Files
--
src/backend/optimizer/path/allpaths.c  |  28 ++--
src/backend/optimizer/plan/initsplan.c |  22 +++-
src/backend/optimizer/plan/planner.c   |  80 ---
src/backend/optimizer/prep/prepunion.c | 234 +++--
src/include/nodes/relation.h   |   8 +-
src/test/regress/expected/inherit.out  |  22 
src/test/regress/expected/join.out |  53 
src/test/regress/sql/inherit.sql   |  17 +++
src/test/regress/sql/join.sql  |  23 
9 files changed, 350 insertions(+), 137 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: Make RelationGetPartitionDispatchInfo expand depth-first.

2017-09-14 Thread Robert Haas
Make RelationGetPartitionDispatchInfo expand depth-first.

With this change, the order of leaf partitions as returned by
RelationGetPartitionDispatchInfo should now be the same as the
order used by expand_inherited_rtentry.  This will make it simpler
for future patches to match up the partition dispatch information
with the planner data structures.  The new code is also, in my
opinion anyway, simpler and easier to understand.

Amit Langote, reviewed by Amit Khandekar.  I also reviewed and
made a few cosmetic revisions.

Discussion: 
http://postgr.es/m/d98d4761-5071-1762-501e-0e15047c7...@lab.ntt.co.jp

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/77b6b5e9ceca04dbd6f0f6cd3fc881519acc8714

Modified Files
--
src/backend/catalog/partition.c| 252 ++---
src/backend/optimizer/prep/prepunion.c |   7 +
2 files changed, 116 insertions(+), 143 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 inconsistent capitalization.

2017-09-14 Thread Robert Haas
Fix inconsistent capitalization.

Amit Langote

Discussion: 
http://postgr.es/m/a83a0899-19f5-594c-9aac-3ba0f1698...@lab.ntt.co.jp

Branch
--
REL_10_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/29f021160ea7bfbc02600e651cf3588bb4ce8e78

Modified Files
--
src/backend/commands/tablecmds.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 inconsistent capitalization.

2017-09-14 Thread Robert Haas
Fix inconsistent capitalization.

Amit Langote

Discussion: 
http://postgr.es/m/a83a0899-19f5-594c-9aac-3ba0f1698...@lab.ntt.co.jp

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/42651bdd68a123544d5bfd0773a170aa3b443f1b

Modified Files
--
src/backend/commands/tablecmds.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: Set partitioned_rels appropriately when UNION ALL is used.

2017-09-14 Thread Robert Haas
Set partitioned_rels appropriately when UNION ALL is used.

In most cases, this omission won't matter, because the appropriate
locks will have been acquired during parse/plan or by AcquireExecutorLocks.
But it's a bug all the same.

Report by Ashutosh Bapat.  Patch by me, reviewed by Amit Langote.

Discussion: 
http://postgr.es/m/cafjfprdhb_znodtubxqrudwxh3h1iblkr6nhscft96fsk4d...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/166d9ee1a996a28cc4601840a67831112695

Modified Files
--
src/backend/optimizer/path/allpaths.c | 42 +++
src/backend/optimizer/plan/planner.c  |  6 ++---
2 files changed, 40 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


[COMMITTERS] pgsql: Set partitioned_rels appropriately when UNION ALL is used.

2017-09-14 Thread Robert Haas
Set partitioned_rels appropriately when UNION ALL is used.

In most cases, this omission won't matter, because the appropriate
locks will have been acquired during parse/plan or by AcquireExecutorLocks.
But it's a bug all the same.

Report by Ashutosh Bapat.  Patch by me, reviewed by Amit Langote.

Discussion: 
http://postgr.es/m/cafjfprdhb_znodtubxqrudwxh3h1iblkr6nhscft96fsk4d...@mail.gmail.com

Branch
--
REL_10_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/448aa36e8b969da257bb58a6fe3db6498d48d4e8

Modified Files
--
src/backend/optimizer/path/allpaths.c | 42 +++
src/backend/optimizer/plan/planner.c  |  6 ++---
2 files changed, 40 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: Allow a partitioned table to have a default partition.

2017-09-08 Thread Robert Haas
On Fri, Sep 8, 2017 at 6:50 PM, Tom Lane <t...@sss.pgh.pa.us> wrote:
> But it ain't.  It's failing on empty partition expressions, and there's
> a short-circuit exit from map_partition_varattnos.
>
> Will fix.

Thanks.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
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 a partitioned table to have a default partition.

2017-09-08 Thread Robert Haas
Allow a partitioned table to have a default partition.

Any tuples that don't route to any other partition will route to the
default partition.

Jeevan Ladhe, Beena Emerson, Ashutosh Bapat, Rahila Syed, and Robert
Haas, with review and testing at various stages by (at least) Rushabh
Lathia, Keith Fiske, Amit Langote, Amul Sul, Rajkumar Raghuanshi, Sven
Kunze, Kyotaro Horiguchi, Thom Brown, Rafia Sabih, and Dilip Kumar.

Discussion: 
http://postgr.es/m/CAH2L28tbN4SYyhS7YV1YBWcitkqbhSWfQCy0G=aprcc_peo...@mail.gmail.com
Discussion: 
http://postgr.es/m/caog9apeyj34fwmcvbmbq-ytqr9ftdxhdn82qekg0svz6zel...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/6f6b99d1335be8ea1b74581fc489a97b109dd08a

Modified Files
--
doc/src/sgml/catalogs.sgml |  11 +
doc/src/sgml/ref/alter_table.sgml  |  31 +-
doc/src/sgml/ref/create_table.sgml |  35 +-
src/backend/catalog/heap.c |  41 +-
src/backend/catalog/partition.c| 644 ++---
src/backend/commands/tablecmds.c   | 187 +++--
src/backend/nodes/copyfuncs.c  |   1 +
src/backend/nodes/equalfuncs.c |   1 +
src/backend/nodes/outfuncs.c   |   1 +
src/backend/nodes/readfuncs.c  |   1 +
src/backend/parser/gram.y  |  27 +-
src/backend/parser/parse_utilcmd.c |  12 +
src/backend/utils/adt/ruleutils.c  |   8 +-
src/bin/psql/describe.c|  11 +-
src/bin/psql/tab-complete.c|   4 +-
src/include/catalog/catversion.h   |   2 +-
src/include/catalog/partition.h|   7 +
src/include/catalog/pg_partitioned_table.h |  13 +-
src/include/commands/tablecmds.h   |   4 +
src/include/nodes/parsenodes.h |   1 +
src/test/regress/expected/alter_table.out  |  49 +++
src/test/regress/expected/create_table.out |  20 +
src/test/regress/expected/insert.out   | 147 ++-
src/test/regress/expected/plancache.out|  26 ++
src/test/regress/expected/sanity_check.out |   4 +
src/test/regress/expected/update.out   |  33 ++
src/test/regress/sql/alter_table.sql   |  47 +++
src/test/regress/sql/create_table.sql  |  20 +
src/test/regress/sql/insert.sql|  69 +++-
src/test/regress/sql/plancache.sql |  21 +
src/test/regress/sql/update.sql|  24 ++
31 files changed, 1367 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: Refactor get_partition_for_tuple a bit.

2017-09-07 Thread Robert Haas
Refactor get_partition_for_tuple a bit.

Pending patches for both default partitioning and hash partitioning
find the current coding pattern to be inconvenient.  Change it so that
we switch on the partitioning method first and then do whatever is
needed.

Amul Sul, reviewed by Jeevan Ladhe, with a few adjustments by me.

Discussion: 
http://postgr.es/m/CAAJ_b97mTb=dg2pv6+1ougxevzfvnzjajw+0qhj46mee7ws...@mail.gmail.com
Discussion: 
http://postgr.es/m/CAOgcT0M37CAztEinpvjJc18EdHfm23fw0EG9-36Ya=+refu...@mail.gmail.com

Branch
--
master

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

Modified Files
--
src/backend/catalog/partition.c | 100 +---
1 file changed, 52 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


[COMMITTERS] pgsql: Even if some partitions are foreign, allow tuple routing.

2017-09-07 Thread Robert Haas
Even if some partitions are foreign, allow tuple routing.

This doesn't allow routing tuple to the foreign partitions themselves,
but it permits tuples to be routed to regular partitions despite the
presence of foreign partitions in the same inheritance hierarchy.

Etsuro Fujita, reviewed by Amit Langote and by me.

Discussion: 
http://postgr.es/m/bc3db4c1-1693-3b8a-559f-33ad2b50b...@lab.ntt.co.jp

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/9d71323daca412e6e175595e1e42809fb5e1172d

Modified Files
--
contrib/file_fdw/input/file_fdw.source  | 21 +
contrib/file_fdw/output/file_fdw.source | 81 +
src/backend/executor/execMain.c | 25 ++
src/backend/executor/nodeModifyTable.c  |  2 +-
src/include/executor/executor.h |  2 +-
5 files changed, 120 insertions(+), 11 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: Even if some partitions are foreign, allow tuple routing.

2017-09-07 Thread Robert Haas
Even if some partitions are foreign, allow tuple routing.

This doesn't allow routing tuple to the foreign partitions themselves,
but it permits tuples to be routed to regular partitions despite the
presence of foreign partitions in the same inheritance hierarchy.

Etsuro Fujita, reviewed by Amit Langote and by me.

Discussion: 
http://postgr.es/m/bc3db4c1-1693-3b8a-559f-33ad2b50b...@lab.ntt.co.jp

Branch
--
REL_10_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/08cb36417aa22436647a1831a7d1ff6b41232280

Modified Files
--
contrib/file_fdw/data/list1.csv |  2 +
contrib/file_fdw/data/list2.bad |  2 +
contrib/file_fdw/data/list2.csv |  2 +
contrib/file_fdw/input/file_fdw.source  | 21 +
contrib/file_fdw/output/file_fdw.source | 81 +
src/backend/executor/execMain.c | 25 ++
src/backend/executor/nodeModifyTable.c  |  2 +-
src/include/executor/executor.h |  2 +-
8 files changed, 126 insertions(+), 11 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: Tighten up some code in RelationBuildPartitionDesc.

2017-09-01 Thread Robert Haas
Tighten up some code in RelationBuildPartitionDesc.

This probably doesn't save anything meaningful in terms of
performance, but making the code simpler is a good idea anyway.

Code by Beena Emerson, extracted from a larger patch by Jeevan
Ladhe, slightly adjusted by me.

Discussion: 
http://postgr.es/m/caogct0ongwajdtkoq+auykdtpy9clwwljxt_k4sxue3eiea...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/0cb8b7531db063bce7def2ef24f616285f1f4b04

Modified Files
--
src/backend/catalog/partition.c | 54 +
1 file changed, 17 insertions(+), 37 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: pg_dumpall: Add a -E flag to set the encoding, like pg_dump has.

2017-09-01 Thread Robert Haas
pg_dumpall: Add a -E flag to set the encoding, like pg_dump has.

Michael Paquier, reviewed by Fabien Coelho

Discussion: 
http://postgr.es/m/CAB7nPqQcYWmrm2n-dVaMUhYPKFU_DxQwPuUGuC4ZF+8B=ds...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/84be67181aab22ea8723ba0625ee690223cd8785

Modified Files
--
doc/src/sgml/ref/pg_dumpall.sgml | 13 +
src/bin/pg_dump/pg_dumpall.c | 24 +++-
2 files changed, 36 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: Use group updates when setting transaction status in clog.

2017-09-01 Thread Robert Haas
Use group updates when setting transaction status in clog.

Commit 0e141c0fbb211bdd23783afa731e3eef95c9ad7a introduced a mechanism
to reduce contention on ProcArrayLock by having a single process clear
XIDs in the procArray on behalf of multiple processes, reducing the
need to hand the lock around.  A previous attempt to introduce a similar
mechanism for CLogControlLock in ccce90b398673d55b0387b3de66639b1b30d451b
crashed and burned, but the design problem which resulted in those
failures is believed to have been corrected in this version.

Amit Kapila, with some cosmetic changes by me.  See the previous commit
message for additional credits.

Discussion: 
http://postgr.es/m/CAA4eK1KudxzgWhuywY_X=yesahjmt4dwcjrov5ay60xaeb2...@mail.gmail.com

Branch
--
master

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

Modified Files
--
doc/src/sgml/monitoring.sgml  |   6 +-
src/backend/access/transam/clog.c | 264 --
src/backend/postmaster/pgstat.c   |   3 +
src/backend/storage/lmgr/proc.c   |   9 ++
src/include/pgstat.h  |   1 +
src/include/storage/proc.h|  14 ++
6 files changed, 285 insertions(+), 12 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 assorted carelessness about Datum vs. int64 vs. uint64

2017-08-31 Thread Robert Haas
Fix assorted carelessness about Datum vs. int64 vs. uint64

Bugs introduced by commit 81c5e46c490e2426db243eada186995da5bb0ba7

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/7b69b6ceb8047979ddf82af12ec1de143da62263

Modified Files
--
src/backend/utils/adt/arrayfuncs.c | 2 +-
src/backend/utils/adt/date.c   | 5 +++--
src/backend/utils/adt/numeric.c| 2 +-
src/backend/utils/adt/rangetypes.c | 5 +++--
4 files changed, 8 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


[COMMITTERS] pgsql: Try to repair poorly-considered code in previous commit.

2017-08-31 Thread Robert Haas
Try to repair poorly-considered code in previous commit.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/0d9506d125beef18247a5e38a219d3b23e2d312e

Modified Files
--
src/backend/utils/adt/jsonb_op.c | 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: Introduce 64-bit hash functions with a 64-bit seed.

2017-08-31 Thread Robert Haas
Introduce 64-bit hash functions with a 64-bit seed.

This will be useful for hash partitioning, which needs a way to seed
the hash functions to avoid problems such as a hash index on a hash
partitioned table clumping all values into a small portion of the
bucket space; it's also useful for anything that wants a 64-bit hash
value rather than a 32-bit hash value.

Just in case somebody wants a 64-bit hash value that is compatible
with the existing 32-bit hash values, make the low 32-bits of the
64-bit hash value match the 32-bit hash value when the seed is 0.

Robert Haas and Amul Sul

Discussion: 
http://postgr.es/m/ca+tgmoafx2yojuhcqqol5cocei-w_ug4s2xt0etgijnpgch...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/81c5e46c490e2426db243eada186995da5bb0ba7

Modified Files
--
doc/src/sgml/xindex.sgml|  13 +-
src/backend/access/hash/hashfunc.c  | 372 +++-
src/backend/access/hash/hashpage.c  |   2 +-
src/backend/access/hash/hashutil.c  |   6 +-
src/backend/access/hash/hashvalidate.c  |  42 +++-
src/backend/commands/opclasscmds.c  |  34 ++-
src/backend/utils/adt/acl.c |  15 ++
src/backend/utils/adt/arrayfuncs.c  |  79 ++
src/backend/utils/adt/date.c|  21 ++
src/backend/utils/adt/jsonb_op.c|  43 
src/backend/utils/adt/jsonb_util.c  |  43 
src/backend/utils/adt/mac.c |   9 +
src/backend/utils/adt/mac8.c|   9 +
src/backend/utils/adt/network.c |  10 +
src/backend/utils/adt/numeric.c |  60 +
src/backend/utils/adt/pg_lsn.c  |   6 +
src/backend/utils/adt/rangetypes.c  |  63 +
src/backend/utils/adt/timestamp.c   |  19 ++
src/backend/utils/adt/uuid.c|   8 +
src/backend/utils/adt/varchar.c |  18 ++
src/backend/utils/cache/lsyscache.c |   8 +-
src/backend/utils/cache/typcache.c  |  58 -
src/include/access/hash.h   |  32 ++-
src/include/catalog/catversion.h|   2 +-
src/include/catalog/pg_amproc.h |  36 +++
src/include/catalog/pg_proc.h   |  54 
src/include/fmgr.h  |   1 +
src/include/utils/jsonb.h   |   2 +
src/include/utils/typcache.h|   4 +
src/test/regress/expected/alter_generic.out |   4 +-
src/test/regress/expected/hash_func.out | 300 ++
src/test/regress/parallel_schedule  |   2 +-
src/test/regress/sql/hash_func.sql  | 222 +
33 files changed, 1555 insertions(+), 42 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 low-level backup documentation.

2017-08-31 Thread Robert Haas
Improve low-level backup documentation.

Our documentation hasn't really caught up with the fact that
non-exclusive backups can now be taken using pg_start_backup and
pg_stop_backup even on standbys.  Update.

David Steele, reviewed by Robert Haas and Michael Paquier

Discussion: 
http://postgr.es/m/f349b834-1443-ebf0-3c2a-965f94400...@pgmasters.net

Branch
--
REL9_6_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/9b1d48506a87a0ac61a1501a4253b6e6e524b87a

Modified Files
--
doc/src/sgml/backup.sgml | 27 +--
doc/src/sgml/func.sgml   | 15 +--
2 files changed, 34 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


[COMMITTERS] pgsql: Expand partitioned tables in PartDesc order.

2017-08-31 Thread Robert Haas
Expand partitioned tables in PartDesc order.

Previously, we expanded the inheritance hierarchy in the order in
which find_all_inheritors had locked the tables, but that turns out
to block quite a bit of useful optimization.  For example, a
partition-wise join can't count on two tables with matching bounds
to get expanded in the same order.

Where possible, this change results in expanding partitioned tables in
*bound* order.  Bound order isn't well-defined for a list-partitioned
table with a null-accepting partition or for a list-partitioned table
where the bounds for a single partition are interleaved with other
partitions.  However, when expansion in bound order is possible, it
opens up further opportunities for optimization, such as
strength-reducing MergeAppend to Append when the expansion order
matches the desired sort order.

Patch by me, with cosmetic revisions by Ashutosh Bapat.

Discussion: 
http://postgr.es/m/CA+TgmoZrKj7kEzcMSum3aXV4eyvvbh9WD=c6m=002wmhedy...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/30833ba154e0c1106d61e3270242dc5999a3e4f3

Modified Files
--
src/backend/optimizer/prep/prepunion.c | 328 ++---
src/test/regress/expected/insert.out   |   4 +-
2 files changed, 220 insertions(+), 112 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: Propagate sort instrumentation from workers back to leader.

2017-08-29 Thread Robert Haas
Propagate sort instrumentation from workers back to leader.

Up until now, when parallel query was used, no details about the
sort method or space used by the workers were available; details
were shown only for any sorting done by the leader.  Fix that.

Commit 1177ab1dabf72bafee8f19d904cee3a299f25892 forced the test case
added by commit 1f6d515a67ec98194c23a5db25660856c9aab944 to run
without parallelism; now that we have this infrastructure, allow
that again, with a little tweaking to make it pass with and without
force_parallel_mode.

Robert Haas and Tom Lane

Discussion: 
http://postgr.es/m/CA+Tgmoa2VBZW6S8AAXfhpHczb=rf6rqq2br+zjvegwj0uod...@mail.gmail.com

Branch
--
master

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

Modified Files
--
src/backend/commands/explain.c  |  57 +++-
src/backend/executor/execParallel.c | 155 ++--
src/backend/executor/nodeSort.c |  97 
src/backend/utils/sort/tuplesort.c  |  56 +---
src/include/executor/nodeSort.h |   7 ++
src/include/nodes/execnodes.h   |  12 +++
src/include/utils/tuplesort.h   |  34 ++-
src/test/regress/expected/subselect.out |   5 +-
src/test/regress/sql/subselect.sql  |   6 +-
9 files changed, 342 insertions(+), 87 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: Push tuple limits through Gather and Gather Merge.

2017-08-29 Thread Robert Haas
Push tuple limits through Gather and Gather Merge.

If we only need, say, 10 tuples in total, then we certainly don't need
more than 10 tuples from any single process.  Pushing down the limit
lets workers exit early when possible.  For Gather Merge, there is
an additional benefit: a Sort immediately below the Gather Merge can
be done as a bounded sort if there is an applicable limit.

Robert Haas and Tom Lane

Discussion: 
http://postgr.es/m/ca+tgmoya3qkkrlj5rx7uvgqhh73g1li4b-ekxrmasaca2tf...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/3452dc5240da43e833118484e1e9b4894d04431c

Modified Files
--
src/backend/executor/execParallel.c   |  54 +---
src/backend/executor/execProcnode.c   | 121 ++
src/backend/executor/nodeGather.c |   4 +-
src/backend/executor/nodeGatherMerge.c|   4 +-
src/backend/executor/nodeLimit.c  |  98 -
src/include/executor/execParallel.h   |   2 +-
src/include/executor/executor.h   |   1 +
src/include/nodes/execnodes.h |   2 +
src/test/regress/expected/select_parallel.out |  24 -
src/test/regress/sql/select_parallel.sql  |   9 +-
10 files changed, 222 insertions(+), 97 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 low-level backup documentation.

2017-08-25 Thread Robert Haas
Improve low-level backup documentation.

Our documentation hasn't really caught up with the fact that
non-exclusive backups can now be taken using pg_start_backup and
pg_stop_backup even on standbys.  Update, also correcting some
errors introduced by 52f8a59dd953c6820baf153e97cf07d31b8ac1d6.
Updates to the 9.6 documentation are needed as well, but that
will need a separate patch as some things are different on that
version.

David Steele, reviewed by Robert Haas and Michael Paquier

Discussion: 
http://postgr.es/m/d4d951b9-89c0-6bc1-b6ff-d0b2dd5a8...@pgmasters.net

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/449338cc644be6035d05afb6b60f536adfd99b3e

Modified Files
--
doc/src/sgml/backup.sgml | 37 ++---
doc/src/sgml/func.sgml   |  3 ++-
2 files changed, 24 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: Improve low-level backup documentation.

2017-08-25 Thread Robert Haas
Improve low-level backup documentation.

Our documentation hasn't really caught up with the fact that
non-exclusive backups can now be taken using pg_start_backup and
pg_stop_backup even on standbys.  Update, also correcting some
errors introduced by 52f8a59dd953c6820baf153e97cf07d31b8ac1d6.
Updates to the 9.6 documentation are needed as well, but that
will need a separate patch as some things are different on that
version.

David Steele, reviewed by Robert Haas and Michael Paquier

Discussion: 
http://postgr.es/m/d4d951b9-89c0-6bc1-b6ff-d0b2dd5a8...@pgmasters.net

Branch
--
REL_10_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/3460728c67852d80569a0382e187480f08771778

Modified Files
--
doc/src/sgml/backup.sgml | 37 ++---
doc/src/sgml/func.sgml   |  3 ++-
2 files changed, 24 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


Re: [COMMITTERS] pgsql: Push limit through subqueries to underlying sort, where possible

2017-08-23 Thread Robert Haas
On Wed, Aug 23, 2017 at 5:55 PM, Andres Freund <and...@anarazel.de> wrote:
> On 2017-08-21 18:42:56 +0000, Robert Haas wrote:
>> Push limit through subqueries to underlying sort, where possible.
>>
>> Douglas Doole, reviewed by Ashutosh Bapat and by me.  Minor formatting
>> change by me.
>>
>> Discussion: 
>> http://postgr.es/m/cade5jyluugneeusyw6q_4mzfytxhxavcqmgasf0yiy8zdgg...@mail.gmail.com
>
> This seems to have caused some buildfarm failures:
>
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=lapwing=2017-08-23%2019%3A15%3A01
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=mantid=2017-08-23%2019%3A33%3A18
>
> (note the commits they started failing after)

Yeah, I noticed that earlier but didn't get time to reply.  I've now
replied on the original thread.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
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: pg_prewarm: Add automatic prewarm feature.

2017-08-21 Thread Robert Haas
pg_prewarm: Add automatic prewarm feature.

Periodically while the server is running, and at shutdown, write out a
list of blocks in shared buffers.  When the server reaches consistency
-- unfortunatey, we can't do it before that point without breaking
things -- reload those blocks into any still-unused shared buffers.

Mithun Cy and Robert Haas, reviewed and tested by Beena Emerson,
Amit Kapila, Jim Nasby, and Rafia Sabih.

Discussion: 
http://postgr.es/m/cad__ougubos1vy7kgf6xtjmeqtr4crgav8w+zbay_+mzeit...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/79ccd7cbd5ca44bee0191d12e9e65abf702899e7

Modified Files
--
contrib/file_fdw/data/list1.csv |   2 +
contrib/file_fdw/data/list2.bad |   2 +
contrib/file_fdw/data/list2.csv |   2 +
contrib/pg_prewarm/Makefile |   4 +-
contrib/pg_prewarm/autoprewarm.c| 924 
contrib/pg_prewarm/pg_prewarm--1.1--1.2.sql |  14 +
contrib/pg_prewarm/pg_prewarm.control   |   2 +-
doc/src/sgml/pgprewarm.sgml |  69 ++-
src/backend/storage/buffer/freelist.c   |  17 +
src/include/storage/buf_internals.h |   1 +
src/tools/pgindent/typedefs.list|   2 +
11 files changed, 1035 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: Push limit through subqueries to underlying sort, where possible

2017-08-21 Thread Robert Haas
Push limit through subqueries to underlying sort, where possible.

Douglas Doole, reviewed by Ashutosh Bapat and by me.  Minor formatting
change by me.

Discussion: 
http://postgr.es/m/cade5jyluugneeusyw6q_4mzfytxhxavcqmgasf0yiy8zdgg...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/1f6d515a67ec98194c23a5db25660856c9aab944

Modified Files
--
src/backend/executor/nodeLimit.c| 26 +
src/test/regress/expected/subselect.out | 52 +
src/test/regress/sql/subselect.sql  | 46 +
3 files changed, 124 insertions(+)


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


  1   2   3   4   5   6   7   8   9   10   >