Re: pgsql: Skip full index scan during cleanup of B-tree indexes when possi

2018-04-04 Thread Tom Lane
Peter Geoghegan writes: >>> TRAP: FailedAssertion("!(metad->btm_version == 3)", File: >>> "/home/pg/postgresql/root/build/../source/src/backend/access/nbtree/nbtpage.c", >>> Line: 619) >> Hm, buildfarm's not complaining --- what's the test case? > This was discovered while

pgsql: doc: Improve indentation of SQL examples

2018-04-04 Thread Peter Eisentraut
doc: Improve indentation of SQL examples Some of these were indented using 8 spaces whereas the rest uses 4 spaces. Probably originally some difference in tab size. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a56e26784d7f418015a5be471eb500614a2f24ee Modified

Re: pgsql: Skip full index scan during cleanup of B-tree indexes when possi

2018-04-04 Thread Tom Lane
Peter Geoghegan writes: > I also see an assertion failure within _bt_getrootheight(): > TRAP: FailedAssertion("!(metad->btm_version == 3)", File: > "/home/pg/postgresql/root/build/../source/src/backend/access/nbtree/nbtpage.c", > Line: 619) Hm, buildfarm's not complaining ---

Re: pgsql: Skip full index scan during cleanup of B-tree indexes when possi

2018-04-04 Thread Michael Paquier
On Wed, Apr 04, 2018 at 08:58:14PM -0400, Tom Lane wrote: > Peter Geoghegan writes: > > I also see an assertion failure within _bt_getrootheight(): > > > TRAP: FailedAssertion("!(metad->btm_version == 3)", File: > >

Re: pgsql: Skip full index scan during cleanup of B-tree indexes when possi

2018-04-04 Thread Peter Geoghegan
On Wed, Apr 4, 2018 at 8:28 PM, Tom Lane wrote: >> This was discovered while testing/reviewing the latest version of the >> INCLUDE covering indexes patch. It now seems to be unrelated. > > Oh, wait ... I wonder if you saw that because you were running a new > backend without

Re: pgsql: New files for MERGE

2018-04-04 Thread Michael Paquier
On Wed, Apr 04, 2018 at 10:10:46AM -0700, Andres Freund wrote: > This needs at the very least a response to the issues pointed out in the > referenced email that you chose to ignore without any sort of comment. That's definitely not cool. -- Michael signature.asc Description: PGP signature

pgsql: Install errcodes.txt for use by extensions.

2018-04-04 Thread Andrew Gierth
Install errcodes.txt for use by extensions. Maintainers of out-of-tree PLs typically need access to the set of error codes. To avoid the need to duplicate that information in some form in PL source trees, provide errcodes.txt as part of a server installation. Thomas Munro, based on a suggestion

Re: pgsql: Skip full index scan during cleanup of B-tree indexes when possi

2018-04-04 Thread Alexander Korotkov
Hi! On Wed, Apr 4, 2018 at 7:29 PM, Teodor Sigaev wrote: > Skip full index scan during cleanup of B-tree indexes when possible > Thank you for committing this. It appears that patch contains some redundant variabled. See warnings produced by gcc-7. nbtpage.c: In function

Re: pgsql: Skip full index scan during cleanup of B-tree indexes when possi

2018-04-04 Thread Peter Geoghegan
On Wed, Apr 4, 2018 at 5:58 PM, Tom Lane wrote: >> TRAP: FailedAssertion("!(metad->btm_version == 3)", File: >> "/home/pg/postgresql/root/build/../source/src/backend/access/nbtree/nbtpage.c", >> Line: 619) > > Hm, buildfarm's not complaining --- what's the test case? This was

Re: pgsql: Skip full index scan during cleanup of B-tree indexes when possi

2018-04-04 Thread Peter Geoghegan
On Wed, Apr 4, 2018 at 3:32 PM, Alexander Korotkov wrote: > Hi! > > On Wed, Apr 4, 2018 at 7:29 PM, Teodor Sigaev wrote: >> >> Skip full index scan during cleanup of B-tree indexes when possible > > > Thank you for committing this. > > It appears that

pgsql: Fix the new ARMv8 CRC code for short and unaligned input.

2018-04-04 Thread Heikki Linnakangas
Fix the new ARMv8 CRC code for short and unaligned input. The code before the main loop, to handle the possible 1-7 unaligned bytes at the beginning of the input, was broken, and read past the input, if the the input was very short. Branch -- master Details ---

Re: pgsql: Transforms for jsonb to PL/Perl

2018-04-04 Thread Anthony Bykov
On Tue, 03 Apr 2018 17:37:04 -0400 Tom Lane wrote: > I wrote: > > Hm, it fails on my own machine too (RHEL6, perl 5.10.1), with the > > same "cannot transform this Perl type to jsonb" symptoms. A bit > > of tracing shows that SvTYPE(in) is returning SVt_PVIV in some > > of

Re: pgsql: Transforms for jsonb to PL/Perl

2018-04-04 Thread Tom Lane
Anthony Bykov writes: > Tom Lane wrote: >> This results in one change in the module's test results: the example >> that thinks it's returning a regexp match result no longer fails, >> but just returns the scalar result (0). I'm inclined to think that

Re: pgsql: Optimize btree insertions for common case of increasing values

2018-04-04 Thread Pavan Deolasee
On Thu, Mar 29, 2018 at 4:39 AM, Peter Geoghegan wrote: > > > Suggested next steps to deal with this: > > * A minor point: I don't think you should call > RelationSetTargetBlock() when the page P_ISROOT(), which, as I > mentioned, is a condition that can coexist with P_ISLEAF()

Re: pgsql: Validate page level checksums in base backups

2018-04-04 Thread Michael Banck
Hi, On Wed, Apr 04, 2018 at 11:38:35AM +0200, Magnus Hagander wrote: > On Tue, Apr 3, 2018 at 10:48 PM, Michael Banck > wrote: > > > Hi, > > > > On Tue, Apr 03, 2018 at 08:48:08PM +0200, Magnus Hagander wrote: > > > On Tue, Apr 3, 2018 at 8:29 PM, Tom Lane

pgsql: Fix platform and Perl-version dependencies in new jsonb_plperl c

2018-04-04 Thread Tom Lane
Fix platform and Perl-version dependencies in new jsonb_plperl code. Testing SvTYPE() directly is more fraught with problems than one might think, because depending on context Perl might be storing a scalar value in one of several forms, eg both numeric and string values. This resulted in

Re: pgsql: Transforms for jsonb to PL/Perl

2018-04-04 Thread Tom Lane
I wrote: > Anthony Bykov writes: >> I guess the right test will look a little bit different: >> CREATE FUNCTION testRegexpToJsonb() RETURNS jsonb >> LANGUAGE plperl >> TRANSFORM FOR TYPE jsonb >> AS $$ >> $a = qr//; >> return ($a); >> $$; > This is testing something else.

pgsql: Remove less-portable-than-believed test case.

2018-04-04 Thread Tom Lane
Remove less-portable-than-believed test case. In commit 331b2369c I added a test to see what jsonb_plperl would do with a qr{} result. Turns out the answer is Perl version dependent. That fact doesn't bother me particularly, but coping with multiple result possibilities is way more work than

Re: pgsql: New files for MERGE

2018-04-04 Thread Andres Freund
Hi, On 2018-04-03 08:32:45 -0700, Andres Freund wrote: > Hi, > > On 2018-04-03 09:24:12 +, Simon Riggs wrote: > > New files for MERGE > > src/backend/executor/nodeMerge.c | 575 +++ > > src/backend/parser/parse_merge.c | 660 > >

Re: pgsql: Optimize btree insertions for common case of increasing values

2018-04-04 Thread Peter Geoghegan
On Wed, Apr 4, 2018 at 5:33 AM, Pavan Deolasee wrote: > Ok. Adding a check for tree height and setting target block only if it's >= > 2, as suggested by you and Simon later. Rahila helped me also ran another > round of tests and this does not lead to any performance

pgsql: Foreign keys on partitioned tables

2018-04-04 Thread Alvaro Herrera
Foreign keys on partitioned tables Author: Álvaro Herrera Discussion: https://postgr.es/m/20171231194359.cvojcour423ulha4@alvherre.pgsql Reviewed-by: Peter Eisentraut Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3de241dba86f3dd000434f70aebba725fb928032 Modified

pgsql: Skip full index scan during cleanup of B-tree indexes when possi

2018-04-04 Thread Teodor Sigaev
Skip full index scan during cleanup of B-tree indexes when possible Vacuum of index consists from two stages: multiple (zero of more) ambulkdelete calls and one amvacuumcleanup call. When workload on particular table is append-only, then autovacuum isn't intended to touch this table. However,

pgsql: Improve FSM management for BRIN indexes.

2018-04-04 Thread Tom Lane
Improve FSM management for BRIN indexes. BRIN indexes like to propagate additions of free space into the upper pages of their free space maps as soon as the new space is known, even when it's just on one individual index page. Previously this required calling FreeSpaceMapVacuum, which is quite

Re: pgsql: New files for MERGE

2018-04-04 Thread Pavan Deolasee
On Thu, Apr 5, 2018 at 12:16 AM, Andres Freund wrote: > Hi, > > On 2018-04-05 00:02:06 +0530, Pavan Deolasee wrote: > > Apologies from my end. Simon checked with me regarding your referenced > > email. I was in the middle of responding to it (with a add-on patch to > take > >

pgsql: Rewrite pg_dump TAP tests

2018-04-04 Thread Stephen Frost
Rewrite pg_dump TAP tests This reworks how the tests to run are defined. Instead of having to define all runs for all tests, we define those tests which should pass (generally using one of the defined broad hashes), add in any which should be specific for this test, and exclude any specific runs

Re: pgsql: New files for MERGE

2018-04-04 Thread Pavan Deolasee
On Wed, Apr 4, 2018 at 10:40 PM, Andres Freund wrote: > Hi, > > On 2018-04-03 08:32:45 -0700, Andres Freund wrote: > > Hi, > > > > On 2018-04-03 09:24:12 +, Simon Riggs wrote: > > > New files for MERGE > > > src/backend/executor/nodeMerge.c | 575

Re: pgsql: New files for MERGE

2018-04-04 Thread Andres Freund
Hi, On 2018-04-05 00:02:06 +0530, Pavan Deolasee wrote: > Apologies from my end. Simon checked with me regarding your referenced > email. I was in the middle of responding to it (with a add-on patch to take > care of your review comments), but got side tracked by some high priority > customer

Re: pgsql: New files for MERGE

2018-04-04 Thread Peter Geoghegan
On Wed, Apr 4, 2018 at 11:46 AM, Andres Freund wrote: > Hows that an explanation for just going ahead and committing? Without > even commenting on why one thinks the pointed out issues are something > that can be resolved later or somesuch? This has an incredibly rushed >

pgsql: docs: update ltree URL for the DMOZ catalog

2018-04-04 Thread Bruce Momjian
docs: update ltree URL for the DMOZ catalog Reported-by: bbrin...@gmail.com Discussion: https://postgr.es/m/152283596377.1441.11672249301622760...@wrigleys.postgresql.org Author: Oleg Bartunov Backpatch-through: 9.3 Branch -- REL9_5_STABLE Details ---

pgsql: docs: update ltree URL for the DMOZ catalog

2018-04-04 Thread Bruce Momjian
docs: update ltree URL for the DMOZ catalog Reported-by: bbrin...@gmail.com Discussion: https://postgr.es/m/152283596377.1441.11672249301622760...@wrigleys.postgresql.org Author: Oleg Bartunov Backpatch-through: 9.3 Branch -- REL9_6_STABLE Details ---

pgsql: docs: update ltree URL for the DMOZ catalog

2018-04-04 Thread Bruce Momjian
docs: update ltree URL for the DMOZ catalog Reported-by: bbrin...@gmail.com Discussion: https://postgr.es/m/152283596377.1441.11672249301622760...@wrigleys.postgresql.org Author: Oleg Bartunov Backpatch-through: 9.3 Branch -- REL_10_STABLE Details ---

pgsql: docs: update ltree URL for the DMOZ catalog

2018-04-04 Thread Bruce Momjian
docs: update ltree URL for the DMOZ catalog Reported-by: bbrin...@gmail.com Discussion: https://postgr.es/m/152283596377.1441.11672249301622760...@wrigleys.postgresql.org Author: Oleg Bartunov Backpatch-through: 9.3 Branch -- REL9_4_STABLE Details ---

pgsql: docs: update ltree URL for the DMOZ catalog

2018-04-04 Thread Bruce Momjian
docs: update ltree URL for the DMOZ catalog Reported-by: bbrin...@gmail.com Discussion: https://postgr.es/m/152283596377.1441.11672249301622760...@wrigleys.postgresql.org Author: Oleg Bartunov Backpatch-through: 9.3 Branch -- master Details ---

pgsql: docs: update ltree URL for the DMOZ catalog

2018-04-04 Thread Bruce Momjian
docs: update ltree URL for the DMOZ catalog Reported-by: bbrin...@gmail.com Discussion: https://postgr.es/m/152283596377.1441.11672249301622760...@wrigleys.postgresql.org Author: Oleg Bartunov Backpatch-through: 9.3 Branch -- REL9_3_STABLE Details ---

pgsql: Restore erroneously removed ONLY from PK check

2018-04-04 Thread Alvaro Herrera
Restore erroneously removed ONLY from PK check This is a blind fix, since I don't have SE-Linux to verify it. Per unwanted change in rhinoceros, running sepgsql tests. Noted by Tom Lane. Discussion: https://postgr.es/m/32347.1522865...@sss.pgh.pa.us Branch -- master Details ---

Re: pgsql: Restore erroneously removed ONLY from PK check

2018-04-04 Thread Andres Freund
On 2018-04-04 19:38:57 +, Alvaro Herrera wrote: > Restore erroneously removed ONLY from PK check > > This is a blind fix, since I don't have SE-Linux to verify it. > > Per unwanted change in rhinoceros, running sepgsql tests. Noted by Tom > Lane. > > Discussion:

Re: pgsql: Restore erroneously removed ONLY from PK check

2018-04-04 Thread Tom Lane
Andres Freund writes: > Shouldn't the difference due to the ONLY be visible in cases with > inheritance? As in, spuriously succeeding or such? Seems like > something that a normal regression test would be good for? Yeah, if it actually matters (which I think it does), it

pgsql: Also fix the descriptions in pg_config.h.win32.

2018-04-04 Thread Heikki Linnakangas
Also fix the descriptions in pg_config.h.win32. I missed pg_config.h.win32 in the previous commit that fixed these in pg_config.h.in. Branch -- REL9_6_STABLE Details --- https://git.postgresql.org/pg/commitdiff/0d2012c9f04afe375200d16d539a9ec5c0093c07 Modified Files --

pgsql: Also fix the descriptions in pg_config.h.win32.

2018-04-04 Thread Heikki Linnakangas
Also fix the descriptions in pg_config.h.win32. I missed pg_config.h.win32 in the previous commit that fixed these in pg_config.h.in. Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/8ed5249afff499d79bb9414a0340c495fccf53b1 Modified Files --

pgsql: Also fix the descriptions in pg_config.h.win32.

2018-04-04 Thread Heikki Linnakangas
Also fix the descriptions in pg_config.h.win32. I missed pg_config.h.win32 in the previous commit that fixed these in pg_config.h.in. Branch -- REL9_5_STABLE Details --- https://git.postgresql.org/pg/commitdiff/0b650285269d6055d0f1c8b10e96a49b118a6d0d Modified Files --

pgsql: Also fix the descriptions in pg_config.h.win32.

2018-04-04 Thread Heikki Linnakangas
Also fix the descriptions in pg_config.h.win32. I missed pg_config.h.win32 in the previous commit that fixed these in pg_config.h.in. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/638a199fa9459dac42b588ccfcf7003539f37416 Modified Files --

pgsql: Fix pg_bsaebackup checksum tests

2018-04-04 Thread Magnus Hagander
Fix pg_bsaebackup checksum tests Hopefully fix the fact that these checks are unstable, by introducing the corruption in a separate table from pg_class, and also explicitly disable autovacuum on those tables. Also make sure PostgreSQL is stopped while the corruption is introduced to avoid

pgsql: Use ARMv8 CRC instructions where available.

2018-04-04 Thread Heikki Linnakangas
Use ARMv8 CRC instructions where available. ARMv8 introduced special CPU instructions for calculating CRC-32C. Use them, when available, for speed. Like with the similar Intel CRC instructions, several factors affect whether the instructions can be used. The compiler intrinsics for them must be

Re: pgsql: Transforms for jsonb to PL/Perl

2018-04-04 Thread Anthony Bykov
On Tue, 03 Apr 2018 17:37:04 -0400 Tom Lane wrote: > I wrote: > > Hm, it fails on my own machine too (RHEL6, perl 5.10.1), with the > > same "cannot transform this Perl type to jsonb" symptoms. A bit > > of tracing shows that SvTYPE(in) is returning SVt_PVIV in some > > of

pgsql: Fix incorrect description of USE_SLICING_BY_8_CRC32C.

2018-04-04 Thread Heikki Linnakangas
Fix incorrect description of USE_SLICING_BY_8_CRC32C. And a typo in the description of USE_SSE42_CRC32C_WITH_RUNTIME_CHECK, spotted by Daniel Gustafsson. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/8989f52b1b0636969545e6c8f6c813bc563ebcf5 Modified Files

pgsql: Fix incorrect description of USE_SLICING_BY_8_CRC32C.

2018-04-04 Thread Heikki Linnakangas
Fix incorrect description of USE_SLICING_BY_8_CRC32C. And a typo in the description of USE_SSE42_CRC32C_WITH_RUNTIME_CHECK, spotted by Daniel Gustafsson. Branch -- REL9_6_STABLE Details --- https://git.postgresql.org/pg/commitdiff/7be511a767cf41f808ee77911bec0f341d04c5fc Modified Files

pgsql: Fix incorrect description of USE_SLICING_BY_8_CRC32C.

2018-04-04 Thread Heikki Linnakangas
Fix incorrect description of USE_SLICING_BY_8_CRC32C. And a typo in the description of USE_SSE42_CRC32C_WITH_RUNTIME_CHECK, spotted by Daniel Gustafsson. Branch -- REL9_5_STABLE Details --- https://git.postgresql.org/pg/commitdiff/127f489c2c7e9ff0e6cd5f990dab497ea3cf7e87 Modified Files

pgsql: Fix incorrect description of USE_SLICING_BY_8_CRC32C.

2018-04-04 Thread Heikki Linnakangas
Fix incorrect description of USE_SLICING_BY_8_CRC32C. And a typo in the description of USE_SSE42_CRC32C_WITH_RUNTIME_CHECK, spotted by Daniel Gustafsson. Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/a3c64ed6ce0da2d18e56179cac8bd752cf79f4b7 Modified Files

Re: pgsql: Validate page level checksums in base backups

2018-04-04 Thread Magnus Hagander
On Tue, Apr 3, 2018 at 10:48 PM, Michael Banck wrote: > Hi, > > On Tue, Apr 03, 2018 at 08:48:08PM +0200, Magnus Hagander wrote: > > On Tue, Apr 3, 2018 at 8:29 PM, Tom Lane wrote: > > I'd bet a good lunch that nondefault BLCKSZ would break it, as