pgsql: Move _bt_upgrademetapage() into critical section.

2018-05-30 Thread Teodor Sigaev
Move _bt_upgrademetapage() into critical section. Any changes on page should be done in critical section, so move _bt_upgrademetapage into critical section. Improve comment. Found by Amit Kapila during post-commit review of 857f9c36. Author: Amit Kapila Branch -- master Details --- http

pgsql: Various improvements of skipping index scan during vacuum techni

2018-05-10 Thread Teodor Sigaev
Various improvements of skipping index scan during vacuum technics - Change vacuum_cleanup_index_scale_factor GUC to PGC_USERSET. vacuum_cleanup_index_scale_factor GUC was defined as PGC_SIGHUP. But this GUC affects not only autovacuum. So it might be useful to change it from user session

pgsql: Improve jsonb cast error message

2018-05-09 Thread Teodor Sigaev
Improve jsonb cast error message Initial variant of error message didn't follow style of another casting error messages and wasn't informative. Per gripe from Robert Haas. Reviewer: Tom Lane Discussion: https://www.postgresql.org/message-id/flat/CA%2BTgmob08StTV9yu04D0idRFNMh%2BUoyKax5Otvrix7rEZ

pgsql: Don't truncate away non-key attributes for leftmost downlinks.

2018-05-04 Thread Teodor Sigaev
Don't truncate away non-key attributes for leftmost downlinks. nbtsort.c does not need to truncate away non-key attributes for the minimum key of the leftmost page on a level, since this is only used to build a minus infinity downlink for the level's leftmost page. Truncating away non-key attribut

pgsql: Re-think predicate locking on GIN indexes.

2018-05-04 Thread Teodor Sigaev
Re-think predicate locking on GIN indexes. The principle behind the locking was not very well thought-out, and not documented. Add a section in the README to explain how it's supposed to work, and change the code so that it actually works that way. This fixes two bugs: 1. If fast update was turn

pgsql: Add HOLD_INTERRUPTS section into FinishPreparedTransaction.

2018-05-03 Thread Teodor Sigaev
Add HOLD_INTERRUPTS section into FinishPreparedTransaction. If an interrupt arrives in the middle of FinishPreparedTransaction and any callback decide to call CHECK_FOR_INTERRUPTS (e.g. RemoveTwoPhaseFile can write a warning with ereport, which checks for interrupts) then it's possible to leave cu

pgsql: Add HOLD_INTERRUPTS section into FinishPreparedTransaction.

2018-05-03 Thread Teodor Sigaev
Add HOLD_INTERRUPTS section into FinishPreparedTransaction. If an interrupt arrives in the middle of FinishPreparedTransaction and any callback decide to call CHECK_FOR_INTERRUPTS (e.g. RemoveTwoPhaseFile can write a warning with ereport, which checks for interrupts) then it's possible to leave cu

pgsql: Add HOLD_INTERRUPTS section into FinishPreparedTransaction.

2018-05-03 Thread Teodor Sigaev
Add HOLD_INTERRUPTS section into FinishPreparedTransaction. If an interrupt arrives in the middle of FinishPreparedTransaction and any callback decide to call CHECK_FOR_INTERRUPTS (e.g. RemoveTwoPhaseFile can write a warning with ereport, which checks for interrupts) then it's possible to leave cu

pgsql: Add HOLD_INTERRUPTS section into FinishPreparedTransaction.

2018-05-03 Thread Teodor Sigaev
Add HOLD_INTERRUPTS section into FinishPreparedTransaction. If an interrupt arrives in the middle of FinishPreparedTransaction and any callback decide to call CHECK_FOR_INTERRUPTS (e.g. RemoveTwoPhaseFile can write a warning with ereport, which checks for interrupts) then it's possible to leave cu

pgsql: Add HOLD_INTERRUPTS section into FinishPreparedTransaction.

2018-05-03 Thread Teodor Sigaev
Add HOLD_INTERRUPTS section into FinishPreparedTransaction. If an interrupt arrives in the middle of FinishPreparedTransaction and any callback decide to call CHECK_FOR_INTERRUPTS (e.g. RemoveTwoPhaseFile can write a warning with ereport, which checks for interrupts) then it's possible to leave cu

pgsql: Add HOLD_INTERRUPTS section into FinishPreparedTransaction.

2018-05-03 Thread Teodor Sigaev
Add HOLD_INTERRUPTS section into FinishPreparedTransaction. If an interrupt arrives in the middle of FinishPreparedTransaction and any callback decide to call CHECK_FOR_INTERRUPTS (e.g. RemoveTwoPhaseFile can write a warning with ereport, which checks for interrupts) then it's possible to leave cu

pgsql: Fix pg_dump support for pre-8.2 versions

2018-05-03 Thread Teodor Sigaev
Fix pg_dump support for pre-8.2 versions Unify indnkeys/indnatts/indnkeyatts usage for all version of query to get index information, remove indnkeys column from query as unused. Author: Marina Polyakova Noticed by: Peter Eisentraut Branch -- master Details --- https://git.postgresql.

Re: pgsql: Indexes with INCLUDE columns and their support in B-tree

2018-05-03 Thread Teodor Sigaev
Thank you, will see Peter Eisentraut wrote: On 4/7/18 16:01, Teodor Sigaev wrote: Indexes with INCLUDE columns and their support in B-tree pg_dump from <8.2 servers is now failing. The last branch in getIndexes() is not producing the required indnkeyatts column. -- Teodor Sig

pgsql: Add amcheck missing downlink tests.

2018-04-25 Thread Teodor Sigaev
Add amcheck missing downlink tests. Also use palloc0() for main amcheck state, and adjust a few comments. Somehow I pushed old version of patch in commit 4eaf7eaccb291f5d32d9f05284bfca9c5744de9a, so commit the difference. Peter Geoghegan Branch -- master Details --- https://git.postgre

pgsql: Add missing and dangling downlink checks to amcheck

2018-04-25 Thread Teodor Sigaev
, especially when the index has high fan-out. Author: Peter Geoghegan Reviewer: Teodor Sigaev Discussion: https://postgr.es/m/cah2-wznuzy4fwtjm1tbb3jpvz8ccfz7k_qvp5bhupyhivmw...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff

pgsql: Make bms_prev_member work correctly with a 64 bit bitmapword

2018-04-23 Thread Teodor Sigaev
Make bms_prev_member work correctly with a 64 bit bitmapword 5c067521 erroneously had coded bms_prev_member assuming that a bitmapword would always hold 32 bits and started it's search on what it thought was the highest 8-bits of the word. This was not the case if bitmapwords were 64 bits. In pa

pgsql: Update trigram example in docs to correct state

2018-04-23 Thread Teodor Sigaev
Update trigram example in docs to correct state Author: Liudmila Mantrova Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/9975c128a1d1bd7e7366adf133b21540a2bc2450 Modified Files -- doc/src/sgml/pgtrgm.sgml | 6 +++--- 1 file changed, 3 insertions(+), 3 d

pgsql: Fix wrong validation of top-parent pointer during page deletion

2018-04-23 Thread Teodor Sigaev
usion with page high key: high key is used to store top-parent link for branch to remove. Bug found by Michael Paquier, but bug doesn't exist in previous versions because t_tid was set to P_HIKEY. Author: Teodor Sigaev Reviewer: Peter Geoghegan Discussion: https://www.postgresql.org/message-id

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

2018-04-19 Thread Teodor Sigaev
Thank you, both patches are pushed. Alexander Korotkov wrote: On Wed, Apr 18, 2018 at 9:21 PM, Peter Geoghegan <mailto:p...@bowt.ie>> wrote: On Wed, Apr 18, 2018 at 11:12 AM, Fujii Masao mailto:masao.fu...@gmail.com>> wrote: > On Thu, Apr 5, 2018 at 1:29 AM, Teodor

pgsql: Fix datatype for number of heap tuples during last cleanup

2018-04-19 Thread Teodor Sigaev
Fix datatype for number of heap tuples during last cleanup It appears that new fields introduced in 857f9c36 have inconsistent datatypes: BTMetaPageData.btm_last_cleanup_num_heap_tuples is of float4 type, while xl_btree_metadata.last_cleanup_num_heap_tuples is of double type. IndexVacuumInfo.num_h

pgsql: Adjust _bt_insertonpg() comments

2018-04-19 Thread Teodor Sigaev
Adjust _bt_insertonpg() comments Remove an obsolete reference to the 'afteritem' argument, which was removed by commit bc292937. Add a comment that clarifies how _bt_insertonpg() indirectly handles the insertion of high key items. Author: Peter Geoghegan Branch -- master Details --- ht

pgsql: Handle XLOG_BTREE_META_CLEANUP in btree_desc() and btree_identif

2018-04-18 Thread Teodor Sigaev
Handle XLOG_BTREE_META_CLEANUP in btree_desc() and btree_identify() New WAL record XLOG_BTREE_META_CLEANUP introduced in 857f9c36 has no handling in btree_desc() and btree_identify(). This patch implements corresponding handling. Alexander Korotkov Branch -- master Details --- https://

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

2018-04-18 Thread Teodor Sigaev
meta page. And there is no support to upgrade meta page since 857f9c36 commit (and should not, because that versions wasn't relesead), to prevent possible false positive bug reports I suggest to bump catversion. Objections? -- Teodor Sigaev E-mail: teo...

pgsql: Adjust INCLUDE index truncation comments and code.

2018-04-18 Thread Teodor Sigaev
ree during a page split, just to be consistent. Refactor _bt_check_natts() to be more readable. Author: Peter Geoghegan with some editorization by me Reviewed by: Alexander Korotkov, Teodor Sigaev Discussion: https://www.postgresql.org/message-id/CAH2-Wz%3DkCWuXeMrBCopC-tFs3FbiVxQNjjgNKdG2

pgsql: Fix interference between covering indexes and partitioned tables

2018-04-12 Thread Teodor Sigaev
Fix interference between covering indexes and partitioned tables The bug is caused due to the original IndexStmt that DefineIndex receives being overwritten when processing the INCLUDE columns. Use separate list of index params to propagate to child tables. Add tests covering this case. Amit Lang

pgsql: Cleanup covering infrastructure

2018-04-12 Thread Teodor Sigaev
Cleanup covering infrastructure - Explicitly forbids opclass, collation and indoptions (like DESC/ASC etc) for including columns. Throw an error if user points that. - Truncated storage arrays for such attributes to store only key atrributes, added assertion checks. - Do not check opfamily and

pgsql: Rename IndexInfo.ii_KeyAttrNumbers array

2018-04-12 Thread Teodor Sigaev
Rename IndexInfo.ii_KeyAttrNumbers array Rename ii_KeyAttrNumbers to ii_IndexAttrNumbers to prevent confusion with ii_NumIndexAttrs/ii_NumIndexKeyAttrs. ii_IndexAttrNumbers contains all attributes including "including" columns, not only key attribute. Discussion: https://www.postgresql.org/messa

pgsql: Temporary revert 5c6110c6a960ad6fe1b0d0fec6ae36ef4eb913f5

2018-04-11 Thread Teodor Sigaev
Temporary revert 5c6110c6a960ad6fe1b0d0fec6ae36ef4eb913f5 It discovers one more bug in CompareIndexInfo(), should be fixed first. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/9282e13a089fb8915b02e45792998996530e Modified Files -- src/backend/comm

Re: pgsql: Fix interference between cavering indexes and partitioned tables

2018-04-11 Thread Teodor Sigaev
Andres Freund wrote: On 2018-04-11 19:04:53 +0300, Teodor Sigaev wrote: Seems, something is wrong here, investigating... pg_upgrade test fails only with -O2 on my box. Assert, debug could be any. Several of the failing animals aren't using optimization, so it can't be just tha

Re: pgsql: Fix interference between cavering indexes and partitioned tables

2018-04-11 Thread Teodor Sigaev
Seems, something is wrong here, investigating... pg_upgrade test fails only with -O2 on my box. Assert, debug could be any. -- Teodor Sigaev E-mail: teo...@sigaev.ru WWW: http://www.sigaev.ru/

Re: pgsql: Fix interference between cavering indexes and partitioned tables

2018-04-11 Thread Teodor Sigaev
Seems, something is wrong here, investigating... Teodor Sigaev wrote: Fix interference between cavering indexes and partitioned tables The bug is caused due to the original IndexStmt that DefineIndex receives being overwritten when processing the INCLUDE columns. Use separate list of index

pgsql: Fix interference between cavering indexes and partitioned tables

2018-04-11 Thread Teodor Sigaev
Fix interference between cavering indexes and partitioned tables The bug is caused due to the original IndexStmt that DefineIndex receives being overwritten when processing the INCLUDE columns. Use separate list of index params to propagate to child tables. Add tests covering this case. Amit Lang

Re: pgsql: Fix behavior of ~> (cube, int) operator

2018-04-10 Thread Teodor Sigaev
Pushed, thank you Alexander Korotkov wrote: On Sun, Jan 21, 2018 at 11:20 PM, Tom Lane <mailto:t...@sss.pgh.pa.us>> wrote: Teodor Sigaev mailto:teo...@sigaev.ru>> writes: > Fix behavior of ~> (cube, int) operator This patch has caused Coverity to complain, co

pgsql: Remove wrongly backpatched piece of code in cube.c

2018-04-10 Thread Teodor Sigaev
Remove wrongly backpatched piece of code in cube.c Due to sloppy division of changes between f50c80dbb (which was not back-patched) and 563a053bd, this piece of code was wrongly backpatched to REL_10_STABLE and REL9_6_STABLE. This code never causes real error because its condition is never satisf

pgsql: Remove wrongly backpatched piece of code in cube.c

2018-04-10 Thread Teodor Sigaev
Remove wrongly backpatched piece of code in cube.c Due to sloppy division of changes between f50c80dbb (which was not back-patched) and 563a053bd, this piece of code was wrongly backpatched to REL_10_STABLE and REL9_6_STABLE. This code never causes real error because its condition is never satisf

Re: pgsql: Fix behavior of ~> (cube, int) operator

2018-04-10 Thread Teodor Sigaev
to 10 and 9.6. -- Teodor Sigaev E-mail: teo...@sigaev.ru WWW: http://www.sigaev.ru/

pgsql: Improve covering index documentation

2018-04-09 Thread Teodor Sigaev
Improve covering index documentation Add missed description of pg_constraint.conincluding Shinoda, Noriyoshi and Alexander Korotkov Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/03c11796a95cc20a4559a103019d4d22a116a13c Modified Files -- doc/src/sgml/

pgsql: Remove repeated test in contrib/amcheck

2018-04-08 Thread Teodor Sigaev
Remove repeated test in contrib/amcheck Repeating these tests adds unnecessary cycles, since no improvement in test coverage is expected. Cleanup from commit 8224de4f42ccf98e08db07b43d52fed72f962ebb. Peter Geoghegan Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/

Re: pgsql: Replace our traditional initial-catalog-data format with a bette

2018-04-08 Thread Teodor Sigaev
ools/msvc/Solution.pm|49 +- src/tools/msvc/clean.bat | 2 + src/tools/pgindent/pgindent | 8 +- 110 files changed, 22928 insertions(+), 12480 deletions(-) -- Teodor Sigaev E-mail: teo...@sigaev.ru WWW: http://www.sigaev.ru/

pgsql: match_clause_to_index should check only key columns

2018-04-08 Thread Teodor Sigaev
match_clause_to_index should check only key columns Alexander Korotkov per gripe from Tom Lane noticed on valgrind-enabled buildfarm members Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/02f3e558f21c0fbec9f94d5de9ad34f321eb0e57 Modified Files -- src/b

Re: pgsql: Indexes with INCLUDE columns and their support in B-tree

2018-04-08 Thread Teodor Sigaev
Thank you, pushed Alexander Korotkov wrote: On Sun, Apr 8, 2018 at 5:41 PM, Tom Lane <mailto:t...@sss.pgh.pa.us>> wrote: Teodor Sigaev mailto:teo...@sigaev.ru>> writes: > Indexes with INCLUDE columns and their support in B-tree The valgrind-using animals seem t

pgsql: Remove unused variable in non-assert-enabled build

2018-04-08 Thread Teodor Sigaev
Remove unused variable in non-assert-enabled build Use field of structure in Assert directly Jeff Janes Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/34602b0a1dfd41400d376e73e41ad868ad2d3ce8 Modified Files -- src/backend/access/common/indextuple.c |

Re: pgsql: Support index INCLUDE in the AM properties interface.

2018-04-08 Thread Teodor Sigaev
| 158 +++--- src/include/access/amapi.h| 9 +- src/test/regress/expected/amutils.out | 57 ++-- src/test/regress/sql/amutils.sql | 17 +++- 5 files changed, 185 insertions(+), 62 deletions(-) -- Teodor Sigaev E-mail: teo...

Re: pgsql: Indexes with INCLUDE columns and their support in B-tree

2018-04-07 Thread Teodor Sigaev
Ooops, sorry, if it possible, I'd like to change list of reviewers to add you, but I don't know how do it. Nevertheless, thank you very much for your work BTW, I miss Andrey Borodin in that list too... Erik Rijkers wrote: On 2018-04-07 22:01, Teodor Sigaev wrote: Indexes wi

pgsql: Indexes with INCLUDE columns and their support in B-tree

2018-04-07 Thread Teodor Sigaev
Indexes with INCLUDE columns and their support in B-tree This patch introduces INCLUDE clause to index definition. This clause specifies a list of columns which will be included as a non-key part in the index. The INCLUDE columns exist solely to allow more queries to benefit from index-only scan

Re: pgsql: Add json(b)_to_tsvector function

2018-04-07 Thread Teodor Sigaev
sql.org/cgi-bin/show_log.pl?nm=fulmar&dt=2018-04-07%2018%3A15%3A15 Probably caused by that animal using a non-standard collation?It should be already fixed in https://git.postgresql.org/pg/commitdiff/01bb85169afadfe63e2f0e344ff671292080de7e -- Teodor Sigaev E-mai

Re: pgsql: Add json(b)_to_tsvector function

2018-04-07 Thread Teodor Sigaev
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=desmoxytes&dt=2018-04-07 18%3A32%3A02 test select_parallel ... FAILED I don't understand how it's connected to json_to_tsquery. Can somebody point me what I'm missing? Teodor Sigaev wrote: Add json(b)_t

pgsql: Make test of json(b)_to_tsvector language-independ

2018-04-07 Thread Teodor Sigaev
Make test of json(b)_to_tsvector language-independ Missed in 1c1791e00065f6986f9d44a78ce7c28b2d1322dd commit Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/01bb85169afadfe63e2f0e344ff671292080de7e Modified Files -- src/test/regress/expected/json.out |

Re: pgsql: Add json(b)_to_tsvector function

2018-04-07 Thread Teodor Sigaev
Forget to add to test 'english' FTS configuration, will fix https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=dunlin&dt=2018-04-07%2018%3A05%3A17 Teodor Sigaev wrote: Add json(b)_to_tsvector function Jsonb has a complex nature so there isn't best-for-everything w

pgsql: Add json(b)_to_tsvector function

2018-04-07 Thread Teodor Sigaev
solve that json(b)_to_tsvector has a second required argument contained a list of desired types of json fields. Second argument is a jsonb scalar or array right now with possibility to add new options in a future. Bump catalog version Author: Dmitry Dolgov with some editorization by me Reviewed

pgsql: Predicate locking in hash indexes.

2018-04-07 Thread Teodor Sigaev
Predicate locking in hash indexes. Hash index searches acquire predicate locks on the primary page of a bucket. It acquires a lock on both the old and new buckets for scans that happen concurrently with page splits. During a bucket split, a predicate lock is copied from the primary page of an old

Re: pgsql: Allow background workers to bypass datallowconn

2018-04-05 Thread Teodor Sigaev
src/include/postmaster/bgworker.h | 7 +-- 11 files changed, 25 insertions(+), 20 deletions(-) -- Teodor Sigaev E-mail: teo...@sigaev.ru WWW: http://www.sigaev.ru/

pgsql: Remove tsearch test contained russian characters, missed in

2018-04-05 Thread Teodor Sigaev
Remove tsearch test contained russian characters, missed in 1664ae1978bf0f5ee940dc2fc8313e6400a7e7da Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/1a8c95365e01c37ff5f51eb803e8ce926fbb0238 Modified Files -- src/test/regress/expected/tsearch.out | 6

Re: pgsql: Add websearch_to_tsquery

2018-04-05 Thread Teodor Sigaev
Miss russion characters in tests, removing Teodor Sigaev wrote: Add websearch_to_tsquery Error-tolerant conversion function with web-like syntax for search query, it simplifies constraining search engine with close to habitual interface for users. Bump catalog version Authors: Victor

pgsql: Add websearch_to_tsquery

2018-04-05 Thread Teodor Sigaev
Add websearch_to_tsquery Error-tolerant conversion function with web-like syntax for search query, it simplifies constraining search engine with close to habitual interface for users. Bump catalog version Authors: Victor Drobny, Dmitry Ivanov with editorization by me Reviewed by: Aleksander Ale

pgsql: Add support of bool, bpchar, name and uuid to btree_gin

2018-04-05 Thread Teodor Sigaev
Add support of bool, bpchar, name and uuid to btree_gin Mostly for completeness, but I believe there are cases to use that in multicolumn GIN indexes. Bump btree_gin module version Author: Matheus Oliveira Reviewed by: Tomas Vondra Discussion: https://www.postgresql.org/message-id/flat/CAJghg4L

pgsql: Fix handling of non-upgraded B-tree metapages

2018-04-05 Thread Teodor Sigaev
Fix handling of non-upgraded B-tree metapages 857f9c36 bumps B-tree metapage version while upgrade is performed "on the fly" when needed. However, some asserts fired when old version metapage was cached to rel->rd_amcache. Despite new metadata fields are never used from rel->rd_amcache, that needs

pgsql: Remove unused vars and mark assert-only vars

2018-04-05 Thread Teodor Sigaev
Remove unused vars and mark assert-only vars Kyotaro HORIGUCHI Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/17d8beb4f52599805283b1f2f49e02491656f7e1 Modified Files -- src/backend/access/nbtree/nbtpage.c | 4 +--- src/backend/access/nbtree/nbtree.c |

pgsql: Fix misprint in documentation

2018-04-05 Thread Teodor Sigaev
Fix misprint in documentation Masahiko Sawada Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a02d51c0d3c0c25d99d2a1cd84f3321640294fa9 Modified Files -- doc/src/sgml/ref/create_index.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Fix typo

2018-04-05 Thread Teodor Sigaev
Fix typo Masahiko Sawada Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/51e6562324f8f03909f1ad1754720e95ae238fad Modified Files -- src/backend/access/nbtree/nbtpage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

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, user

pgsql: Add prefix operator for TEXT type.

2018-04-03 Thread Teodor Sigaev
Add prefix operator for TEXT type. The prefix operator along with SP-GiST indexes can be used as an alternative for LIKE 'word%' commands and it doesn't have a limitation of string/prefix length as B-Tree has. Bump catalog version Author: Ildus Kurbangaliev with some editorization by me Review

pgsql: Predicate locking in GIN index

2018-03-30 Thread Teodor Sigaev
Predicate locking in GIN index Predicate locks are used on per page basis only if fastupdate = off, in opposite case predicate lock on pending list will effectively lock whole index, to reduce locking overhead, just lock a relation. Entry and posting trees are essentially B-tree, so locks are acqu

Re: pgsql: Add casts from jsonb

2018-03-29 Thread Teodor Sigaev
Hm, it was a random failure? Teodor Sigaev wrote: Seems, I broke Windows again, it doesn't like this patch, see https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=whelk&dt=2018-03-29%2013%3A41%3A13 But I don't understand how it could be... Teodor Sigaev wrote: Add ca

Re: pgsql: Add casts from jsonb

2018-03-29 Thread Teodor Sigaev
Seems, I broke Windows again, it doesn't like this patch, see https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=whelk&dt=2018-03-29%2013%3A41%3A13 But I don't understand how it could be... Teodor Sigaev wrote: Add casts from jsonb Add explicit cast from scalar jsonb to a

pgsql: Add casts from jsonb

2018-03-29 Thread Teodor Sigaev
Add casts from jsonb Add explicit cast from scalar jsonb to all numeric and bool types. It would be better to have cast from scalar jsonb to text too but there is already a cast from jsonb to text as just text representation of json. There is no way to have two different casts for the same type's

Re: pgsql: Skip temp tables from basebackup.

2018-03-27 Thread Teodor Sigaev
Thanks for everyone, pushed. Let us follow the pgbuildfarm David Steele wrote: On 3/27/18 10:24 AM, Teodor Sigaev wrote: Hm, seems, Windows doesn't like this patch https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=bowerbird&dt=2018-03-27 sorry for wrong

pgsql: Fix count of skipped test of basebackup on Windows

2018-03-27 Thread Teodor Sigaev
Fix count of skipped test of basebackup on Windows Commit 920a5e500a119b03356fb1fb64a677eb1aa5fc6f add tests which should be skipped on Windows boxes, but patch doesn't contain right count of them. David Steel Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/44bd958

Re: pgsql: Skip temp tables from basebackup.

2018-03-27 Thread Teodor Sigaev
Hm, seems, Windows doesn't like this patch https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=bowerbird&dt=2018-03-27 sorry for wrong URL https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=bowerbird&dt=2018-03-27%2013%3A30%3A24 -- Teodor Sigaev

Re: pgsql: Skip temp tables from basebackup.

2018-03-27 Thread Teodor Sigaev
Hm, seems, Windows doesn't like this patch https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=bowerbird&dt=2018-03-27 David, could you have a look? Teodor Sigaev wrote: Skip temp tables from basebackup. Do not store temp tables in basebackup, they will not be visible anyway,

pgsql: Skip temp tables from basebackup.

2018-03-27 Thread Teodor Sigaev
Skip temp tables from basebackup. Do not store temp tables in basebackup, they will not be visible anyway, so, there are not reasons to store them. Author: David Steel Reviewed by: me Discussion: https://www.postgresql.org/message-id/flat/5ea4d26a-a453-c1b7-eff9-5a3ef8f8a...@pgmasters.net Branc

pgsql: Add predicate locking for GiST

2018-03-27 Thread Teodor Sigaev
Add predicate locking for GiST Add page-level predicate locking, due to gist's code organization, patch seems close to trivial: add check before page changing, add predicate lock before page scanning. Although choosing right place to check is not simple: it should not be called during index build

pgsql: Set random seed for pgbench.

2018-03-26 Thread Teodor Sigaev
Set random seed for pgbench. Setting random could increase reproducibility of test in some cases. Patch suggests three providers for seed: time (default), strong random generator (if available) and unsigned constant. Seed could be set from command line or enviroment variable. Author: Fabien Coelh

pgsql: Exclude unlogged tables from base backups

2018-03-23 Thread Teodor Sigaev
Exclude unlogged tables from base backups Exclude unlogged tables from base backup entirely except init fork which marks created unlogged table. The next question is do not backup temp table but it's a story for separate patch. Author: David Steele Review by: Adam Brightwell, Masahiko Sawada Disc

pgsql: Add conditional.c to libpgfeutils for MSVC build

2018-03-22 Thread Teodor Sigaev
Add conditional.c to libpgfeutils for MSVC build conditional.c was moved in f67b113ac62777d18cd20d3c4d05be964301b936 commit but forgotten to add to Windows build system. I don't have a Windows box, so blind attempt. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2

pgsql: UINT64CONST'fy long constants in pgbench

2018-03-22 Thread Teodor Sigaev
UINT64CONST'fy long constants in pgbench In commit e51a04840a1c45db101686bef0b7025d5014c74b it was missed 64-bit constants, wrap them with UINT64CONST(). Per buildfarm member dromedary and gripe from Tom Lane Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2216fded

Re: pgsql: Add general purpose hasing functions to pgbench.

2018-03-22 Thread Teodor Sigaev
will fix, Tom Lane wrote: Teodor Sigaev writes: Add general purpose hasing functions to pgbench. The 32-bit members of the buildfarm aren't very happy with this, eg on dromedary: cache gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmi

Re: pgsql: Add \if support to pgbench

2018-03-22 Thread Teodor Sigaev
Buildfarm says you didn't account for MSVC build ... Yep, I havn't. Will see -- Teodor Sigaev E-mail: teo...@sigaev.ru WWW: http://www.sigaev.ru/

pgsql: Add \if support to pgbench

2018-03-22 Thread Teodor Sigaev
Add \if support to pgbench Patch adds \if to pgbench as it done for psql. Implementation shares condition stack code with psql, so, this code is moved to fe_utils directory. Author: Fabien COELHO with minor editorization by me Review by: Vik Fearing, Fedor Sigaev Discussion: https://www.postgres

pgsql: Add general purpose hasing functions to pgbench.

2018-03-21 Thread Teodor Sigaev
Add general purpose hasing functions to pgbench. Hashing function is useful for simulating real-world workload in test like WEB workload, as an example - YCSB benchmarks. Author: Ildar Musin with minor editorization by me Reviewed by: Fabien Coelho, me Discussion: https://www.postgresql.org/mess

pgsql: Add strict_word_similarity to pg_trgm module

2018-03-21 Thread Teodor Sigaev
Add strict_word_similarity to pg_trgm module strict_word_similarity is similar to existing word_similarity function but it takes into account word boundaries to compute similarity. Author: Alexander Korotkov Review by: David Steele, Liudmila Mantrova, me Discussion: https://www.postgresql.org/me

pgsql: Rework word_similarity documentation, make it close to actual al

2018-03-21 Thread Teodor Sigaev
Rework word_similarity documentation, make it close to actual algorithm. word_similarity before claimed as returning similarity of closest word in string, but, actually it returns similarity of substring. Also fix mistyped comments. Author: Alexander Korotkov Review by: David Steele, Liudmila Man

pgsql: Rework word_similarity documentation, make it close to actual al

2018-03-21 Thread Teodor Sigaev
Rework word_similarity documentation, make it close to actual algorithm. word_similarity before claimed as returning similarity of closest word in string, but, actually it returns similarity of substring. Also fix mistyped comments. Author: Alexander Korotkov Review by: David Steele, Liudmila Man

pgsql: Rework word_similarity documentation, make it close to actual al

2018-03-21 Thread Teodor Sigaev
Rework word_similarity documentation, make it close to actual algorithm. word_similarity before claimed as returning similarity of closest word in string, but, actually it returns similarity of substring. Also fix mistyped comments. Author: Alexander Korotkov Review by: David Steele, Liudmila Man

pgsql: llow negative coordinate for ~> (cube, int) operator

2018-01-11 Thread Teodor Sigaev
llow negative coordinate for ~> (cube, int) operator ~> (cube, int) operator was especially designed for knn-gist search. However, knn-gist supports only ascending ordering of results. Nevertheless it would be useful to support descending ordering by ~> (cube, int) operator. We provide workaround

pgsql: Fix behavior of ~> (cube, int) operator

2018-01-11 Thread Teodor Sigaev
Fix behavior of ~> (cube, int) operator ~> (cube, int) operator was especially designed for knn-gist search. However, it appears that knn-gist search can't work correctly with current behavior of this operator when dataset contains cubes of variable dimensionality. In this case, the same value of

pgsql: Fix behavior of ~> (cube, int) operator

2018-01-11 Thread Teodor Sigaev
Fix behavior of ~> (cube, int) operator ~> (cube, int) operator was especially designed for knn-gist search. However, it appears that knn-gist search can't work correctly with current behavior of this operator when dataset contains cubes of variable dimensionality. In this case, the same value of

pgsql: Fix behavior of ~> (cube, int) operator

2018-01-11 Thread Teodor Sigaev
Fix behavior of ~> (cube, int) operator ~> (cube, int) operator was especially designed for knn-gist search. However, it appears that knn-gist search can't work correctly with current behavior of this operator when dataset contains cubes of variable dimensionality. In this case, the same value of

Re: pgsql: Improve scripting language in pgbench

2018-01-10 Thread Teodor Sigaev
Thank you very much, applied Thomas Munro wrote: On Wed, Jan 10, 2018 at 4:02 AM, Teodor Sigaev wrote: Improve scripting language in pgbench Hi Teodor, I think this commit might have lost a fix from 0aa1d489ea756b96b6d5573692ae9cd5d143c2a5. bowerbird and jacana now fail when they see an

pgsql: Fix allowing of leading zero on exponents in pgbench test result

2018-01-10 Thread Teodor Sigaev
Fix allowing of leading zero on exponents in pgbench test results Commit bc7fa0c15c590ddf4872e426abd76c2634f22aca accidentally lost fixes of 0aa1d489ea756b96b6d5573692ae9cd5d143c2a5 commit. Thanks to Thomas Munro Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/d16c

pgsql: Improve scripting language in pgbench

2018-01-09 Thread Teodor Sigaev
Improve scripting language in pgbench Added: - variable now might contain integer, double, boolean and null values - functions ln, exp - logical AND/OR/NOT - bitwise AND/OR/NOT/XOR - bit right/left shift - comparison operators - IS [NOT] (NULL|TRUE|FALSE) - conditional choice (in form of w

pgsql: Update relation's stats in pg_class during vacuum full.

2017-12-27 Thread Teodor Sigaev
Update relation's stats in pg_class during vacuum full. Hash index depends on estimation of numbers of tuples and pages of relations, incorrect value could be a reason of significantly growing of index. Vacuum full recreates heap and reindex all indexes before renewal stats. The patch fixes that,

pgsql: Update relation's stats in pg_class during vacuum full.

2017-12-27 Thread Teodor Sigaev
Update relation's stats in pg_class during vacuum full. Hash index depends on estimation of numbers of tuples and pages of relations, incorrect value could be a reason of significantly growing of index. Vacuum full recreates heap and reindex all indexes before renewal stats. The patch fixes that,

pgsql: Add polygon opclass for SP-GiST

2017-12-25 Thread Teodor Sigaev
Add polygon opclass for SP-GiST Polygon opclass uses compress method feature of SP-GiST added earlier. For now it's a single operator class which uses this feature. SP-GiST actually indexes a bounding boxes of input polygons, so part of supported operations are lossy. Opclass uses most methods of

pgsql: Add optional compression method to SP-GiST

2017-12-22 Thread Teodor Sigaev
Add optional compression method to SP-GiST Patch allows to have different types of column and value stored in leaf tuples of SP-GiST. The main application of feature is to transform complex column type to simple indexed type or for truncating too long value, transformation could be lossy. Simple

pgsql: Add approximated Zipfian-distributed random generator to pgbench

2017-12-14 Thread Teodor Sigaev
Add approximated Zipfian-distributed random generator to pgbench. Generator helps to make close to real-world tests. Author: Alik Khilazhev Reviewed-By: Fabien COELHO Discussion: https://www.postgresql.org/message-id/flat/bf3b6f54-68c3-417a-bfab-fb4d66f2b...@postgrespro.ru Branch -- master

pgsql: Make pg_trgm tests independ from standard_conforming_string. Tes

2017-12-12 Thread Teodor Sigaev
Make pg_trgm tests independ from standard_conforming_string. Tests uses regular expression which contains backslash. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c28aa157b86f756d53f2a6b715e23ca56f219b4f Modified Files -- contrib/pg_trgm/expected/pg_tr