[COMMITTERS] pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()
Avoid SnapshotResetXmin() during AtEOXact_Snapshot() For normal commits and aborts we already reset PgXact->xmin, so we can simply avoid running SnapshotResetXmin() twice. During performance tests by Alexander Korotkov, diagnosis by Andres Freund showed PgXact array as a bottleneck. After manual analysis by me of the code paths that touch those memory locations, I was able to identify extraneous code in the main transaction commit path. Avoiding touching highly contented shmem improves concurrent performance slightly on all workloads, confirmed by tests run by Ashutosh Sharma and Alexander Korotkov. Simon Riggs Discussion: canp8+jjdxe9b+b9f8cqt-luxxo0pbcb-szffmvadp+akqo4...@mail.gmail.com Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/6bad580d9e678a0b604883e14d8401d469b06566 Modified Files -- src/backend/access/transam/xact.c | 6 +++--- src/backend/utils/time/snapmgr.c | 14 -- src/include/utils/snapmgr.h | 2 +- 3 files changed, 16 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: Identity columns
Identity columns This is the SQL standard-conforming variant of PostgreSQL's serial columns. It fixes a few usability issues that serial columns have: - CREATE TABLE / LIKE copies default but refers to same sequence - cannot add/drop serialness with ALTER TABLE - dropping default does not drop sequence - need to grant separate privileges to sequence - other slight weirdnesses because serial is some kind of special macro Reviewed-by: Vitaly Burovoy Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/3217327053638085d24dd4d276e7c1f7ac2c4c6b Modified Files -- doc/src/sgml/catalogs.sgml | 11 + doc/src/sgml/information_schema.sgml| 11 +- doc/src/sgml/ref/alter_table.sgml | 47 +++- doc/src/sgml/ref/copy.sgml | 7 + doc/src/sgml/ref/create_table.sgml | 65 - doc/src/sgml/ref/insert.sgml| 41 +++ src/backend/access/common/tupdesc.c | 6 + src/backend/catalog/dependency.c| 7 + src/backend/catalog/genbki.pl | 7 +- src/backend/catalog/heap.c | 15 +- src/backend/catalog/index.c | 1 + src/backend/catalog/information_schema.sql | 17 +- src/backend/catalog/pg_depend.c | 52 ++-- src/backend/catalog/sql_features.txt| 12 +- src/backend/commands/sequence.c | 101 +-- src/backend/commands/tablecmds.c| 295 ++- src/backend/executor/execExpr.c | 12 + src/backend/executor/execExprInterp.c | 23 ++ src/backend/nodes/copyfuncs.c | 23 ++ src/backend/nodes/equalfuncs.c | 18 ++ src/backend/nodes/nodeFuncs.c | 11 + src/backend/nodes/outfuncs.c| 9 + src/backend/nodes/readfuncs.c | 1 + src/backend/parser/analyze.c| 2 + src/backend/parser/gram.y | 134 - src/backend/parser/parse_utilcmd.c | 360 +++- src/backend/rewrite/rewriteHandler.c| 56 +++- src/backend/utils/adt/ruleutils.c | 8 + src/backend/utils/cache/lsyscache.c | 32 +++ src/backend/utils/cache/relcache.c | 1 + src/backend/utils/errcodes.txt | 1 + src/bin/pg_dump/pg_dump.c | 95 ++- src/bin/pg_dump/pg_dump.h | 3 + src/bin/pg_dump/t/002_pg_dump.pl| 87 ++ src/bin/psql/describe.c | 27 +- src/bin/psql/tab-complete.c | 18 +- src/include/catalog/catversion.h| 2 +- src/include/catalog/dependency.h| 8 +- src/include/catalog/pg_attribute.h | 24 +- src/include/catalog/pg_class.h | 2 +- src/include/commands/sequence.h | 2 + src/include/executor/execExpr.h | 8 + src/include/nodes/nodes.h | 1 + src/include/nodes/parsenodes.h | 27 +- src/include/nodes/primnodes.h | 14 + src/include/parser/kwlist.h | 2 + src/include/utils/lsyscache.h | 1 + src/test/regress/expected/create_table_like.out | 47 src/test/regress/expected/identity.out | 322 + src/test/regress/expected/sequence.out | 4 +- src/test/regress/expected/truncate.out | 30 ++ src/test/regress/parallel_schedule | 5 + src/test/regress/serial_schedule| 1 + src/test/regress/sql/create_table_like.sql | 14 + src/test/regress/sql/identity.sql | 192 + src/test/regress/sql/sequence.sql | 2 +- src/test/regress/sql/truncate.sql | 18 ++ 57 files changed, 2140 insertions(+), 202 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: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()
On Thu, Apr 6, 2017 at 8:35 AM, Simon Riggs wrote: > Avoid SnapshotResetXmin() during AtEOXact_Snapshot() > > For normal commits and aborts we already reset PgXact->xmin, > so we can simply avoid running SnapshotResetXmin() twice. > > During performance tests by Alexander Korotkov, diagnosis > by Andres Freund showed PgXact array as a bottleneck. After > manual analysis by me of the code paths that touch those > memory locations, I was able to identify extraneous code > in the main transaction commit path. > > Avoiding touching highly contented shmem improves concurrent > performance slightly on all workloads, confirmed by tests > run by Ashutosh Sharma and Alexander Korotkov. > > Simon Riggs > > Discussion: canp8+jjdxe9b+b9f8cqt-luxxo0pbcb-szffmvadp+akqo4...@mail.gmail.com Just like the last time you committed this, it seems to have broken the entire buildfarm. -- 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: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()
On 6 April 2017 at 09:11, Robert Haas wrote: > Just like the last time you committed this, it seems to have broken > the entire buildfarm. For different reasons, AFAIU. Investigating already. -- Simon Riggshttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers
Re: [COMMITTERS] pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()
Simon Riggs writes: > Avoid SnapshotResetXmin() during AtEOXact_Snapshot() The buildfarm doesn't like this a bit. regards, tom lane -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers
Re: [COMMITTERS] pgsql: Identity columns
Peter Eisentraut writes: > Identity columns This commit is causing a compiler warning for me: tablecmds.c: In function 'ATExecSetIdentity': tablecmds.c:5936: warning: 'address.objectSubId' may be used uninitialized in this function tablecmds.c:5936: warning: 'address.objectId' may be used uninitialized in this function I'm not sure why it's not complaining about all three fields, because AFAICS, the function returns a totally undefined ObjectAddress when generatedEl is not set. What is the intention there? (If the function were adequately documented, maybe I could divine that for myself, but heaven help the reader who would like to know what this function is supposed to do.) regards, tom lane -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers
[COMMITTERS] pgsql: Always SnapshotResetXmin() during ClearTransaction()
Always SnapshotResetXmin() during ClearTransaction() Avoid corner cases during 2PC with 6bad580d9e678a0b604883e14d8401d469b06566 Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/cd0cebaf7d1ab04427d4045edf7121a8f3753d8b Modified Files -- src/backend/access/transam/xact.c | 2 +- src/backend/utils/time/snapmgr.c | 15 +++ src/include/utils/snapmgr.h | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers
[COMMITTERS] pgsql: Remove bogus SCRAM_ITERATION_LEN constant.
Remove bogus SCRAM_ITERATION_LEN constant. It was not used for what the comment claimed, at all. It was actually used as the 'base' argument to strtol(), when reading the iteration count. We don't need a constant for base-10, so remove it. Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/07044efe00762bdd04c4d392adb8f6425b13369b Modified Files -- src/backend/libpq/auth-scram.c | 2 +- src/include/common/scram-common.h| 3 --- src/interfaces/libpq/fe-auth-scram.c | 2 +- 3 files changed, 2 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 compiler warning and add some more comments
Fix compiler warning and add some more comments Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/dc0400cc501ebe839c15a387911945d1585e4787 Modified Files -- src/backend/commands/tablecmds.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
Re: [COMMITTERS] pgsql: Identity columns
On 4/6/17 10:24, Tom Lane wrote: > This commit is causing a compiler warning for me: > > tablecmds.c: In function 'ATExecSetIdentity': > tablecmds.c:5936: warning: 'address.objectSubId' may be used uninitialized in > this function > tablecmds.c:5936: warning: 'address.objectId' may be used uninitialized in > this function > > I'm not sure why it's not complaining about all three fields, because > AFAICS, the function returns a totally undefined ObjectAddress when > generatedEl is not set. Yeah, that was an oversight. It's depressing that not more compilers warn about an obvious case like this. I have pushed a fix. > What is the intention there? (If the function > were adequately documented, maybe I could divine that for myself, but > heaven help the reader who would like to know what this function is > supposed to do.) Added some comments, too. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers
[COMMITTERS] pgsql: Comment fixes for extended statistics
Comment fixes for extended statistics Clean up some code comments in new extended statistics code, from 7b504eb282. Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/b1fc51a36ecdf854be9e41ffb99953c40ef96ccf Modified Files -- src/backend/optimizer/util/plancat.c| 1 + src/backend/statistics/dependencies.c | 9 +++-- src/backend/statistics/extended_stats.c | 7 --- src/backend/utils/cache/relcache.c | 1 - src/include/nodes/relation.h| 8 +++- 5 files changed, 15 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: Fix AclResult vs bool type mix-up
Fix AclResult vs bool type mix-up Using AclResult as a bool or vice versa works by accident, but it's unusual and possibly confusing style, so write it out more explicitly. Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/301ca0d9a2f82ade11b2e5039d348badd28334cf Modified Files -- contrib/pgrowlocks/pgrowlocks.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers
[COMMITTERS] pgsql: doc: Formatting fix for XSL-FO PDF build
doc: Formatting fix for XSL-FO PDF build Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/a071fe87a21920e5c2e79d521d31b2ddaf83875b Modified Files -- doc/src/sgml/stylesheet-fo.xsl | 8 1 file changed, 8 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 mixup of bool and ternary value
Fix mixup of bool and ternary value Not currently a problem, but could be with stricter bool behavior under stdbool or C++. Reviewed-by: Andres Freund Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/e6c9a5a9bcc9774e6a29cf9cea489b42f492e019 Modified Files -- src/backend/access/gin/ginscan.c | 2 +- src/include/access/gin_private.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers
[COMMITTERS] pgsql: Clean up psql/describe.c's messy query for extended stats.
Clean up psql/describe.c's messy query for extended stats. Remove unnecessary casts, safely schema-qualify the ones that remain, lose an unnecessary level of sub-SELECT, reformat for tidiness. Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/20c95f27e736837b4af6bef998cb9408d1ad902e Modified Files -- src/bin/psql/describe.c | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers
[COMMITTERS] pgsql: pg_dump: Rename some typedefs to avoid name conflicts
pg_dump: Rename some typedefs to avoid name conflicts In struct _archiveHandle, some of the fields have the same name as a typedef. This is kind of confusing, so rename the types so they have names distinct from the struct fields. In C++, the previous coding changes the meaning of the typedef in the scope of the struct, causing warnings and possibly other problems. Reviewed-by: Andres Freund Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/4be613f692b8f474d5766627a636e7f838131587 Modified Files -- src/bin/pg_dump/pg_backup.h | 4 +- src/bin/pg_dump/pg_backup_archiver.c | 10 ++-- src/bin/pg_dump/pg_backup_archiver.h | 96 ++-- 3 files changed, 55 insertions(+), 55 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: Mark immutable functions in information schema as parallel safe
Mark immutable functions in information schema as parallel safe Also add opr_sanity check that all preloaded immutable functions are parallel safe. (Per discussion, this does not necessarily have to be true for all possible such functions, but deviations would be unlikely enough that maintaining such a test is reasonable.) Reported-by: David Rowley Reviewed-by: Robert Haas Reviewed-by: Tom Lane Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/5f21f5292c0856536ac0724974a8bc6b296b9ef6 Modified Files -- src/backend/catalog/information_schema.sql | 13 +++-- src/include/catalog/catversion.h | 2 +- src/test/regress/expected/opr_sanity.out | 8 src/test/regress/sql/opr_sanity.sql| 5 + 4 files changed, 25 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 logical replication between different encodings
Fix logical replication between different encodings When sending a tuple attribute, the previous coding erroneously sent the length byte before encoding conversion, which would lead to protocol failures on the receiving side if the length did not match the following string. To fix that, use pq_sendcountedtext() for sending tuple attributes, which takes care of all of that internally. To match the API of pq_sendcountedtext(), send even text values without a trailing zero byte and have the receiving end put it in place instead. This matches how the standard FE/BE protocol behaves. Reported-by: Kyotaro HORIGUCHI Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/6f1b9aaae35bfabe2654a8e44ce226c91e7d8bd9 Modified Files -- doc/src/sgml/protocol.sgml | 7 +++-- src/backend/replication/logical/proto.c | 10 +++ src/test/subscription/t/005_encoding.pl | 46 + 3 files changed, 55 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: Increase parallel bitmap scan test coverage.
Increase parallel bitmap scan test coverage. Author: Dilip Kumar Discussion: https://postgr.es/m/20170331184603.qcp7t4md5bzxb...@alap3.anarazel.de Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/5a5931533edd2b70bde1f069609f58998dd26fef Modified Files -- src/test/regress/expected/select_parallel.out | 40 +++ src/test/regress/sql/select_parallel.sql | 20 -- 2 files changed, 52 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: Add minimal test for EXPLAIN ANALYZE of parallel query.
Add minimal test for EXPLAIN ANALYZE of parallel query. This displays the number of workers launched, thus the test is dependant on configuration to some degree. We'll see whether that turns out ot be a problem. Author: Rafia Sabih Discussion: https://postgr.es/m/20170331185540.zmsue4ndvqtna...@alap3.anarazel.de Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/b2ff37d43cc81348fd8e9d9c5fcc9dfadf790763 Modified Files -- src/test/regress/expected/select_parallel.out | 10 ++ src/test/regress/sql/select_parallel.sql | 3 +++ 2 files changed, 13 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 BRIN cost estimation
Fix BRIN cost estimation The original code was overly optimistic about the cost of scanning a BRIN index, leading to BRIN indexes being selected when they'd be a worse choice than some other index. This complete rewrite should be more accurate. Author: David Rowley, based on an earlier patch by Emre Hasegeli Reviewed-by: Emre Hasegeli Discussion: https://postgr.es/m/cakjs1f9n-wapop5xz1dtgdpdqmzegqqk4sv2mk-zzugfc14...@mail.gmail.com Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/7e534adcdc70866e7be74d626b0ed067c890a251 Modified Files -- src/backend/access/brin/brin.c | 21 src/backend/utils/adt/selfuncs.c | 197 - src/include/access/brin.h | 14 +++ src/test/regress/expected/brin.out | 26 + src/test/regress/sql/brin.sql | 16 +++ 5 files changed, 248 insertions(+), 26 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: Add infrastructure to support EphemeralNamedRelation references.
Hi, On 2017-04-01 04:24:25 +, Kevin Grittner wrote: > Add infrastructure to support EphemeralNamedRelation references. My compiler, quite justifiedly, complains: /home/andres/src/postgresql/src/backend/parser/parse_relation.c: In function ‘get_rte_attribute_is_dropped’: /home/andres/src/postgresql/src/backend/parser/parse_relation.c:2899:43: warning: comparison between pointer and zero character constant [-Wpointer-compare] (list_nth(rte->coltypes, attnum - 1) != InvalidOid); ^~ /home/andres/src/postgresql/src/backend/parser/parse_relation.c:2899:7: note: did you mean to dereference the pointer? (list_nth(rte->coltypes, attnum - 1) != InvalidOid); ^ - Andres -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers
[COMMITTERS] pgsql: Fix parallel bitmapscan tests on builds without USE_PREFETCH.
Fix parallel bitmapscan tests on builds without USE_PREFETCH. This was broken in 5a5931533edd2. Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/d611517fc44ebbf7e0d563de6d4cd98fd342a762 Modified Files -- src/test/regress/expected/select_parallel.out | 7 ++- src/test/regress/sql/select_parallel.sql | 7 ++- 2 files changed, 12 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: Silence compiler warning in sepgsql
Silence compiler warning in sepgsql includes , which creates an incompatible We don't care if redefines "true"/"false"; those are close enough. Complaint and initial patch by Mike Palmiotto. Final approach per Tom Lane's suggestion, as discussed on hackers. Backpatching to all supported branches. Discussion: https://postgr.es/m/flat/623bcaae-112e-ced0-8c22-a84f75ae0c53%40joeconway.com Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/bd190eae36191a6795c4f0fe95419dbf2953d2b0 Modified Files -- contrib/sepgsql/label.c | 12 ++-- 1 file changed, 10 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: Silence compiler warning in sepgsql
Silence compiler warning in sepgsql includes , which creates an incompatible We don't care if redefines "true"/"false"; those are close enough. Complaint and initial patch by Mike Palmiotto. Final approach per Tom Lane's suggestion, as discussed on hackers. Backpatching to all supported branches. Discussion: https://postgr.es/m/flat/623bcaae-112e-ced0-8c22-a84f75ae0c53%40joeconway.com Branch -- REL9_4_STABLE Details --- http://git.postgresql.org/pg/commitdiff/7e71081426a4e14c50fa5d8ad046f915ddf22c42 Modified Files -- contrib/sepgsql/label.c | 12 ++-- 1 file changed, 10 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: Silence compiler warning in sepgsql
Silence compiler warning in sepgsql includes , which creates an incompatible We don't care if redefines "true"/"false"; those are close enough. Complaint and initial patch by Mike Palmiotto. Final approach per Tom Lane's suggestion, as discussed on hackers. Backpatching to all supported branches. Discussion: https://postgr.es/m/flat/623bcaae-112e-ced0-8c22-a84f75ae0c53%40joeconway.com Branch -- REL9_2_STABLE Details --- http://git.postgresql.org/pg/commitdiff/1d6f5b446fc84d8974087e66d2603ef81387a052 Modified Files -- contrib/sepgsql/label.c | 12 ++-- 1 file changed, 10 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: Silence compiler warning in sepgsql
Silence compiler warning in sepgsql includes , which creates an incompatible We don't care if redefines "true"/"false"; those are close enough. Complaint and initial patch by Mike Palmiotto. Final approach per Tom Lane's suggestion, as discussed on hackers. Backpatching to all supported branches. Discussion: https://postgr.es/m/flat/623bcaae-112e-ced0-8c22-a84f75ae0c53%40joeconway.com Branch -- REL9_5_STABLE Details --- http://git.postgresql.org/pg/commitdiff/5fcf1f4e0a0dd075b16c628ba0a05521b4b4b179 Modified Files -- contrib/sepgsql/label.c | 12 ++-- 1 file changed, 10 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: Silence compiler warning in sepgsql
Silence compiler warning in sepgsql includes , which creates an incompatible We don't care if redefines "true"/"false"; those are close enough. Complaint and initial patch by Mike Palmiotto. Final approach per Tom Lane's suggestion, as discussed on hackers. Backpatching to all supported branches. Discussion: https://postgr.es/m/flat/623bcaae-112e-ced0-8c22-a84f75ae0c53%40joeconway.com Branch -- REL9_3_STABLE Details --- http://git.postgresql.org/pg/commitdiff/649cd9085efb2cb4e21eec3b3861f46e89ba3a34 Modified Files -- contrib/sepgsql/label.c | 12 ++-- 1 file changed, 10 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: Silence compiler warning in sepgsql
Silence compiler warning in sepgsql includes , which creates an incompatible We don't care if redefines "true"/"false"; those are close enough. Complaint and initial patch by Mike Palmiotto. Final approach per Tom Lane's suggestion, as discussed on hackers. Backpatching to all supported branches. Discussion: https://postgr.es/m/flat/623bcaae-112e-ced0-8c22-a84f75ae0c53%40joeconway.com Branch -- REL9_6_STABLE Details --- http://git.postgresql.org/pg/commitdiff/dd93afca3a0a4c18ac17ee14f7874994f4ced9b5 Modified Files -- contrib/sepgsql/label.c | 12 ++-- 1 file changed, 10 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: Silence uninitialized variable compiler warning in sepgsql
Silence uninitialized variable compiler warning in sepgsql At -Og optimization gcc warns that variable tclass may be used uninitialized when relkind == RELKIND_INDEX. Actually that can't happen due to an early return, but quiet the compiler by initializing tclass to 0. In passing, use uint16_t consistently for the declaration of tclass. Complaint and initial patch by Mike Palmiotto. Editorializing by me. Probably not worth backpatching given that it is cosmetic, so apply to development head only. Discussion: https://postgr.es/m/flat/623bcaae-112e-ced0-8c22-a84f75ae0c53%40joeconway.com Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/af8a94d18d70ca226a12057ad4b3d17f27d8ff13 Modified Files -- contrib/sepgsql/relation.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: Allow avoiding tuple copy within tuplesort_gettupleslot().
Allow avoiding tuple copy within tuplesort_gettupleslot(). Add a "copy" argument to make it optional to receive a copy of caller tuple that is safe to use following a subsequent manipulating of tuplesort's state. This is a performance optimization. Most existing tuplesort_gettupleslot() callers are made to opt out of copying. Existing callers that happen to rely on the validity of tuple memory beyond subsequent manipulations of the tuplesort request their own copy. This brings tuplesort_gettupleslot() in line with tuplestore_gettupleslot(). In the future, a "copy" tuplesort_getdatum() argument may be added, that similarly allows callers to opt out of receiving their own copy of tuple. In passing, clarify assumptions that callers of other tuplesort fetch routines may make about tuple memory validity, per gripe from Tom Lane. Author: Peter Geoghegan Discussion: CAM3SWZQWZZ_N=DmmL7tKy_OUjGH_5mN=N=a6h7khyydvehg...@mail.gmail.com Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/fa117ee40330db401da776e7b003f047098a7d4c Modified Files -- src/backend/executor/nodeAgg.c | 9 ++--- src/backend/executor/nodeSort.c| 5 +++-- src/backend/utils/adt/orderedsetaggs.c | 5 +++-- src/backend/utils/sort/tuplesort.c | 28 +--- src/include/utils/tuplesort.h | 2 +- 5 files changed, 30 insertions(+), 19 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers
Re: [COMMITTERS] pgsql: Add infrastructure to support EphemeralNamedRelation references.
On Thu, Apr 6, 2017 at 4:19 PM, Andres Freund wrote: > My compiler, quite justifiedly, complains: > > /home/andres/src/postgresql/src/backend/parser/parse_relation.c: In function > ‘get_rte_attribute_is_dropped’: > /home/andres/src/postgresql/src/backend/parser/parse_relation.c:2899:43: > warning: comparison between pointer and zero character constant > [-Wpointer-compare] > (list_nth(rte->coltypes, attnum - 1) != InvalidOid); >^~ > /home/andres/src/postgresql/src/backend/parser/parse_relation.c:2899:7: note: > did you mean to dereference the pointer? > (list_nth(rte->coltypes, attnum - 1) != InvalidOid); >^ Good catch. Will push a change from list_nth() to list_nth_oid() for the benefit of stricter compilers. While I'm at it, I'll throw on another layer of parentheses to ensure people read that correctly. Out of curiosity, what compiler or setting catches this? -- Kevin Grittner -- 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: Add infrastructure to support EphemeralNamedRelation references.
On Fri, Apr 7, 2017 at 10:03 AM, Kevin Grittner wrote: > On Thu, Apr 6, 2017 at 4:19 PM, Andres Freund wrote: > >> My compiler, quite justifiedly, complains: >> >> /home/andres/src/postgresql/src/backend/parser/parse_relation.c: In function >> ‘get_rte_attribute_is_dropped’: >> /home/andres/src/postgresql/src/backend/parser/parse_relation.c:2899:43: >> warning: comparison between pointer and zero character constant >> [-Wpointer-compare] >> (list_nth(rte->coltypes, attnum - 1) != InvalidOid); >>^~ >> /home/andres/src/postgresql/src/backend/parser/parse_relation.c:2899:7: >> note: did you mean to dereference the pointer? >> (list_nth(rte->coltypes, attnum - 1) != InvalidOid); >>^ > > Good catch. Will push a change from list_nth() to list_nth_oid() > for the benefit of stricter compilers. While I'm at it, I'll throw > on another layer of parentheses to ensure people read that > correctly. Out of curiosity, what compiler or setting catches this? Doesn't it also have the logic backwards? According to the comment, the attribute is dropped if the type *is* InvalidOid, so we want result == true in that case. But I don't actually know how to reach this code to test it. /* -* We checked when we loaded ctecoltypes for the tuplestore +* We checked when we loaded coltypes for the tuplestore * that InvalidOid was only used for dropped columns, so it is * safe to count on that here. */ result = - (list_nth(rte->coltypes, attnum - 1) != InvalidOid); + (list_nth_oid(rte->coltypes, attnum - 1) == InvalidOid); } -- Thomas Munro http://www.enterprisedb.com -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers
Re: [COMMITTERS] pgsql: Add infrastructure to support EphemeralNamedRelation references.
On 2017-04-06 17:03:20 -0500, Kevin Grittner wrote: > On Thu, Apr 6, 2017 at 4:19 PM, Andres Freund wrote: > > > My compiler, quite justifiedly, complains: > > > > /home/andres/src/postgresql/src/backend/parser/parse_relation.c: In > > function ‘get_rte_attribute_is_dropped’: > > /home/andres/src/postgresql/src/backend/parser/parse_relation.c:2899:43: > > warning: comparison between pointer and zero character constant > > [-Wpointer-compare] > > (list_nth(rte->coltypes, attnum - 1) != InvalidOid); > >^~ > > /home/andres/src/postgresql/src/backend/parser/parse_relation.c:2899:7: > > note: did you mean to dereference the pointer? > > (list_nth(rte->coltypes, attnum - 1) != InvalidOid); > >^ > > Good catch. Will push a change from list_nth() to list_nth_oid() > for the benefit of stricter compilers. While I'm at it, I'll throw > on another layer of parentheses to ensure people read that > correctly. Out of curiosity, what compiler or setting catches this? gcc-7 here, and the specific warning is -Wpointer-compare. - Andres -- 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: Add infrastructure to support EphemeralNamedRelation references.
On Thu, Apr 6, 2017 at 5:07 PM, Thomas Munro wrote: > Doesn't it also have the logic backwards? According to the comment, > the attribute is dropped if the type *is* InvalidOid, so we want > result == true in that case. But I don't actually know how to reach > this code to test it. You're right. So on this one line I had a reverse logic bug, something that strict compilers would not accept, and code that assumed that readers and compilers would always know that tests for equality or inequality bind tighter than assignment. I'll commit this fix first so I don't hold up Andres or break any picky buildfarm critters and then see whether I can't manage to get the tests to cover this code. Thanks! On Thu, Apr 6, 2017 at 5:16 PM, Andres Freund wrote: > On 2017-04-06 17:03:20 -0500, Kevin Grittner wrote: >> Out of curiosity, what compiler or setting catches this? > > gcc-7 here, and the specific warning is -Wpointer-compare. Thanks! I'll add that to my builds. -- Kevin Grittner -- 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: Add infrastructure to support EphemeralNamedRelation references.
Kevin Grittner writes: > On Thu, Apr 6, 2017 at 4:19 PM, Andres Freund wrote: >> My compiler, quite justifiedly, complains: >> /home/andres/src/postgresql/src/backend/parser/parse_relation.c:2899:43: >> warning: comparison between pointer and zero character constant >> [-Wpointer-compare] >> (list_nth(rte->coltypes, attnum - 1) != InvalidOid); > Good catch. Will push a change from list_nth() to list_nth_oid() > for the benefit of stricter compilers. If the problem is that the list is an OID list, then why didn't the "Assert(IsPointerList(list))" in list_nth fire? Either this is the wrong fix, or this code has never been exercised (at least not in an assert-enabled build). rte->coltypes certainly ought to be an OID list, so I lean to the inadequate-testing theory ... regards, tom lane -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers
[COMMITTERS] pgsql: Fix the RTE_NAMEDTUPLESTORE case in get_rte_attribute_is_dropped
Fix the RTE_NAMEDTUPLESTORE case in get_rte_attribute_is_dropped(). Problems pointed out by Andres Freund and Thomas Munro. Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/255efa241f460ee4f4c4c98c8cdd7457807f3af9 Modified Files -- src/backend/parser/parse_relation.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers
Re: [COMMITTERS] pgsql: Add infrastructure to support EphemeralNamedRelation references.
On Thu, Apr 6, 2017 at 5:20 PM, Kevin Grittner wrote: > I'll commit this fix first so I don't hold up Andres or break any > picky buildfarm critters Done. > and then see whether I can't manage to get > the tests to cover this code. The function in question is only called from rewrite, and here's the relevant comment: * About JOINs and dropped columns: although the parser never includes an * already-dropped column in a JOIN RTE's alias var list, it is possible for * such a list in a stored rule to include references to dropped columns. * (If the column is not explicitly referenced anywhere else in the query, * the dependency mechanism won't consider it used by the rule and so won't * prevent the column drop.) To support get_rte_attribute_is_dropped(), we * replace join alias vars that reference dropped columns with null pointers. So, to test this I guess I need to create a view that does SELECT * on a table, write a plpgsql trigger function and use it as an AFTER EACH STATEMENT trigger on that table -- referencing the view and explicitly using a specific column from the transition table in a join qual, modify the table so the trigger gets fired and the function gets cached, ALTER the table to drop the column so referenced without doing anything that might cause the function plan to be discarded from cache, and then modify the table again to fire the cached trigger. Does that seem like the right test to add? Or would even that fail to reach this code because the transition table is not on the view? Oh well, I guess I'll write the code and find out -- seems easier than reverse-engineering that code path. -- Kevin Grittner -- 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: Reset API of clause_selectivity()
Reset API of clause_selectivity() Discussion: https://postgr.es/m/cakjs1f9yurjqw9pdnzl+rmotsp2voytkpxkgnmfjeo-qz5o...@mail.gmail.com Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/ac2b09508834c9d6b7ec9467e876213b0304c792 Modified Files -- contrib/file_fdw/file_fdw.c| 1 - contrib/postgres_fdw/postgres_fdw.c| 5 +-- src/backend/optimizer/path/clausesel.c | 69 +- src/backend/optimizer/path/costsize.c | 25 +--- src/backend/optimizer/util/orclauses.c | 4 +- src/backend/statistics/dependencies.c | 4 +- src/backend/utils/adt/selfuncs.c | 20 +++--- src/include/optimizer/cost.h | 6 +-- 8 files changed, 74 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: Clean up after insufficiently-researched optimization of tuple c
Clean up after insufficiently-researched optimization of tuple conversions. tupconvert.c's functions formerly considered that an explicit tuple conversion was necessary if the input and output tupdescs contained different type OIDs. The point of that was to make sure that a composite datum resulting from the conversion would contain the destination rowtype OID in its composite-datum header. However, commit 3838074f8 entirely misunderstood what that check was for, thinking that it had something to do with presence or absence of an OID column within the tuple. Removal of the check broke the no-op conversion path in ExecEvalConvertRowtype, as reported by Ashutosh Bapat. It turns out that of the dozen or so call sites for tupconvert.c functions, ExecEvalConvertRowtype is the only one that cares about the composite-datum header fields in the output tuple. In all the rest, we'd much rather avoid an unnecessary conversion whenever the tuples are physically compatible. Moreover, the comments in tupconvert.c only promise physical compatibility not a metadata match. So, let's accept the removal of the guarantee about the output tuple's rowtype marking, recognizing that this is a API change that could conceivably break third-party callers of tupconvert.c. (So, let's remember to mention it in the v10 release notes.) However, commit 3838074f8 did have a bit of a point here, in that two tuples mustn't be considered physically compatible if one has HEAP_HASOID set and the other doesn't. (Some of the callers of tupconvert.c might not really care about that, but we can't assume it in general.) The previous check accidentally covered that issue, because no RECORD types ever have OIDs, while if two tupdescs have the same named composite type OID then, a fortiori, they have the same tdhasoid setting. If we're removing the type OID match check then we'd better include tdhasoid match as part of the physical compatibility check. Without that hack in tupconvert.c, we need ExecEvalConvertRowtype to take responsibility for inserting the correct rowtype OID label whenever tupconvert.c decides it need not do anything. This is easily done with heap_copy_tuple_as_datum, which will be considerably faster than a tuple disassembly and reassembly anyway; so from a performance standpoint this change is a win all around compared to what happened in earlier branches. It just means a couple more lines of code in ExecEvalConvertRowtype. Ashutosh Bapat and Tom Lane Discussion: https://postgr.es/m/cafjfprfvhabv6+ovvgcshf8rhn+1lfruhj7jz1cdz4gpuwe...@mail.gmail.com Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/3f902354b08ac788600f0ae54fcbfc1d4e3ea765 Modified Files -- src/backend/access/common/tupconvert.c | 22 -- src/backend/executor/execExprInterp.c | 34 ++ src/test/regress/expected/rowtypes.out | 9 + src/test/regress/sql/rowtypes.sql | 5 + 4 files changed, 48 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: Remove use of Jade and DSSSL
Remove use of Jade and DSSSL All documentation is now built using XSLT. Remove all references to Jade, DSSSL, also JadeTex and some other outdated tooling. For chunked HTML builds, this changes nothing, but removes the transitional "oldhtml" target. The single-page HTML build is ported over to XSLT. For PDF builds, this removes the JadeTex builds and moves the FOP builds in their place. Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/510074f9f0131a04322d6a3d2a51c87e6db243f9 Modified Files -- config/docbook.m4| 62 --- configure| 180 ++- configure.in | 4 +- doc/src/sgml/.gitignore | 8 - doc/src/sgml/Makefile| 174 ++- doc/src/sgml/docguide.sgml | 619 doc/src/sgml/filelist.sgml | 12 - doc/src/sgml/fixrtf | 46 -- doc/src/sgml/install-windows.sgml| 10 - doc/src/sgml/jadetex.cfg | 89 doc/src/sgml/postgres.sgml | 3 +- doc/src/sgml/stylesheet-html-common.xsl | 266 +++ doc/src/sgml/stylesheet-html-nochunk.xsl | 12 + doc/src/sgml/stylesheet.dsl | 798 --- doc/src/sgml/stylesheet.xsl | 255 +- src/Makefile.global.in | 5 +- 16 files changed, 468 insertions(+), 2075 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 json_populate_record and friends operate recursively
Make json_populate_record and friends operate recursively With this change array fields are populated from json(b) arrays, and composite fields are populated from json(b) objects. Along the way, some significant code refactoring is done to remove redundancy in the way to populate_record[_set] and to_record[_set] functions operate, and some significant efficiency gains are made by caching tuple descriptors. Nikita Glukhov, edited some by me. Reviewed by Aleksander Alekseev and Tom Lane. Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/cf35346e813e5a1373f308d397bb0a8f3f21d530 Modified Files -- doc/src/sgml/func.sgml | 16 +- src/backend/utils/adt/jsonfuncs.c | 1700 --- src/test/regress/expected/json.out | 466 +- src/test/regress/expected/jsonb.out | 478 +- src/test/regress/sql/json.sql | 156 +++- src/test/regress/sql/jsonb.sql | 156 +++- 6 files changed, 2412 insertions(+), 560 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: Identity columns
On 7 April 2017 at 00:44, Peter Eisentraut wrote: > Identity columns > > This is the SQL standard-conforming variant of PostgreSQL's serial > columns. It fixes a few usability issues that serial columns have: > > - CREATE TABLE / LIKE copies default but refers to same sequence > - cannot add/drop serialness with ALTER TABLE > - dropping default does not drop sequence > - need to grant separate privileges to sequence > - other slight weirdnesses because serial is some kind of special macro Attached is a small patch which fixes up a warning for compilers not smart enough to know the elog(ERROR) does not return. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services identity_columns_warning_fix.patch Description: Binary data -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers
[COMMITTERS] pgsql: Remove extraneous comma to satisfy picky compiler
Remove extraneous comma to satisfy picky compiler per buildfarm Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/88dd4e48315878263bcf27e0337daf2b3c1991b8 Modified Files -- src/backend/utils/adt/jsonfuncs.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