pgsql: Add ORDER BY to regression test case

2019-03-25 Thread Peter Eisentraut
Add ORDER BY to regression test case Apparently, the output order is different on different endianness, per build farm member snapper. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c77e12208cd8540a209cc698373a3cfba8802639 Modified Files -- src/test/re

Re: pgsql: Collations with nondeterministic comparison

2019-03-25 Thread Peter Eisentraut
On 2019-03-25 06:07, Tom Lane wrote: > Buildfarm member snapper doesn't like this. I think the problem is > that the queries it's failing on do not bother to constrain their > output row order. Adding an "EXPLAIN" right there indicates that > the INTERSECTs are being done via hashing, meaning tha

pgsql: tableam: Add and use table_fetch_row_version().

2019-03-25 Thread Andres Freund
tableam: Add and use table_fetch_row_version(). This is essentially the tableam version of heapam_fetch(), i.e. fetching a tuple identified by a tid, performing visibility checks. Note that this different from table_index_fetch_tuple(), which is for index lookups. It therefore has to handle a tid

pgsql: Initialize structure at declaration

2019-03-25 Thread Peter Eisentraut
Initialize structure at declaration Avoids extra memset call and cast. Discussion: https://www.postgresql.org/message-id/flat/7a5cbea7-b8df-e910-0f10-04014bcad701%402ndquadrant.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/572e3e6634e55accf95e2bcfb1340019c86

pgsql: Add macro to cast away volatile without allowing changes to unde

2019-03-25 Thread Peter Eisentraut
Add macro to cast away volatile without allowing changes to underlying type This adds unvolatize(), which works just like unconstify() but for volatile. Discussion: https://www.postgresql.org/message-id/flat/7a5cbea7-b8df-e910-0f10-04014bcad701%402ndquadrant.com Branch -- master Details --

pgsql: Align timestamps in pg_regress output

2019-03-25 Thread Peter Eisentraut
Align timestamps in pg_regress output This way the timestamps line up in a mix of "ok" and "FAILED" output. Author: Christoph Berg Discussion: https://www.postgresql.org/message-id/20190321115059.GF2687%40msg.df7cb.de Branch -- master Details --- https://git.postgresql.org/pg/commitdi

pgsql: Clean up the Simple-8b encoder code.

2019-03-25 Thread Heikki Linnakangas
Clean up the Simple-8b encoder code. Coverity complained that simple8b_encode() might read beyond the end of the 'diffs' array, in the loop to encode the integers. That was a false positive, because we never get into the loop in modes 0 or 1, and the array is large enough for all the other modes.

pgsql: Cosmetic changes for jsonpath_gram.y and jsonpath_scan.l

2019-03-25 Thread Alexander Korotkov
Cosmetic changes for jsonpath_gram.y and jsonpath_scan.l This commit include formatting improvements, renamings and comments. Also, it makes jsonpath_scan.l be more uniform with other our lexers. Firstly, states names are renamed to more short alternatives. Secondly, prefix removed from the ru

pgsql: Get rid of backtracking in jsonpath_scan.l

2019-03-25 Thread Alexander Korotkov
Get rid of backtracking in jsonpath_scan.l Non-backtracking flex parsers work faster than backtracking ones. So, this commit gets rid of backtracking in jsonpath_scan.l. That required explicit handling of some cases as well as manual backtracking for some cases. More regression tests for numeri

Re: pgsql: Get rid of backtracking in jsonpath_scan.l

2019-03-25 Thread Robert Haas
On Mon, Mar 25, 2019 at 8:44 AM Alexander Korotkov wrote: > Discussion: > https://mail.google.com/mail/u/0?ik=a20b091faa&view=om&permmsgid=msg-f%3A1628425344167939063 This is really a pretty evil link to include in a commit message. When I clicked on it, it logged me out of my gmail account. --

Re: pgsql: Get rid of backtracking in jsonpath_scan.l

2019-03-25 Thread Alexander Korotkov
On Mon, Mar 25, 2019 at 3:56 PM Robert Haas wrote: > On Mon, Mar 25, 2019 at 8:44 AM Alexander Korotkov > wrote: > > Discussion: > > https://mail.google.com/mail/u/0?ik=a20b091faa&view=om&permmsgid=msg-f%3A1628425344167939063 > > This is really a pretty evil link to include in a commit message.

pgsql: Add progress reporting for CLUSTER and VACUUM FULL.

2019-03-25 Thread Robert Haas
Add progress reporting for CLUSTER and VACUUM FULL. This uses the same progress reporting infrastructure added in commit c16dc1aca5e01e6acaadfcf38f5fc964a381dc62 and extends it to these additional cases. We lack the ability to track the internal progress of sorts and index builds so the informati

pgsql: pgbench: Remove \cset

2019-03-25 Thread Alvaro Herrera
pgbench: Remove \cset Partial revert of commit 6260cc550b0e, "pgbench: add \cset and \gset commands". While \gset is widely considered a useful and necessary tool for user- defined benchmarks, \cset does not have as much value, and its implementation was considered "not to be up to project standa

pgsql: Fix use of wrong datatype with sizeof().

2019-03-25 Thread Robert Haas
Fix use of wrong datatype with sizeof(). OID and int are the same size, but they are not the same thing. David Rowley Discussion: http://postgr.es/m/CAKJS1f_MhS++XngkTvWL9X1v8M5t-0N0B-R465yHQY=tmnv...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff

Re: pgsql: Allow ATTACH PARTITION with only ShareUpdateExclusiveLock.

2019-03-25 Thread Robert Haas
On Fri, Mar 22, 2019 at 9:21 AM David Rowley wrote: > On Fri, 8 Mar 2019 at 05:39, Robert Haas wrote: > > src/backend/partitioning/partprune.c | 7 +- > > I've attached a small patch that fixes a couple of incorrect sizeof() > calculations new in this commit. > > Perhaps only a problem if size

pgsql: Refactor code to print pgbench progress reports.

2019-03-25 Thread Heikki Linnakangas
Refactor code to print pgbench progress reports. threadRun() function is very long and deeply-nested. Extract the code to print progress reports to a separate function, to make it slightly easier to read. Author: Fabien Coelho Discussion: https://www.postgresql.org/message-id/alpine.DEB.2.21.190

pgsql: Further code review for new integerset code.

2019-03-25 Thread Tom Lane
Further code review for new integerset code. Mostly cosmetic adjustments, but I added a more reliable method of detecting whether an iteration is in progress. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/f7ff0ae8428f9001eab244cb2535f40d29f218e9 Modified Files --

Re: pgsql: Further code review for new integerset code.

2019-03-25 Thread Heikki Linnakangas
On 25/03/2019 18:23, Tom Lane wrote: Further code review for new integerset code. Thanks! Wow, that was an embarrassing number of typos. - Heikki

pgsql: Add "split after new tuple" nbtree optimization.

2019-03-25 Thread Peter Geoghegan
Add "split after new tuple" nbtree optimization. Add additional heuristics to the algorithm for locating an optimal split location. New logic identifies localized monotonically increasing values in indexes with multiple columns. When this insertion pattern is detected, page splits split just aft

pgsql: Suppress Append and MergeAppend plan nodes that have a single ch

2019-03-25 Thread Tom Lane
Suppress Append and MergeAppend plan nodes that have a single child. If there's only one child relation, the Append or MergeAppend isn't doing anything useful, and can be elided. It does have a purpose during planning though, which is to serve as a buffer between parent and child Var numbering.

pgsql: Doc: clarify that REASSIGN OWNED doesn't handle default privileg

2019-03-25 Thread Tom Lane
Doc: clarify that REASSIGN OWNED doesn't handle default privileges. It doesn't touch regular privileges either, but only the latter was explicitly stated. Discussion: https://postgr.es/m/155348282848.9808.12629518043813943...@wrigleys.postgresql.org Branch -- REL_11_STABLE Details ---

pgsql: Doc: clarify that REASSIGN OWNED doesn't handle default privileg

2019-03-25 Thread Tom Lane
Doc: clarify that REASSIGN OWNED doesn't handle default privileges. It doesn't touch regular privileges either, but only the latter was explicitly stated. Discussion: https://postgr.es/m/155348282848.9808.12629518043813943...@wrigleys.postgresql.org Branch -- REL9_4_STABLE Details ---

pgsql: Doc: clarify that REASSIGN OWNED doesn't handle default privileg

2019-03-25 Thread Tom Lane
Doc: clarify that REASSIGN OWNED doesn't handle default privileges. It doesn't touch regular privileges either, but only the latter was explicitly stated. Discussion: https://postgr.es/m/155348282848.9808.12629518043813943...@wrigleys.postgresql.org Branch -- master Details --- https:/

pgsql: Doc: clarify that REASSIGN OWNED doesn't handle default privileg

2019-03-25 Thread Tom Lane
Doc: clarify that REASSIGN OWNED doesn't handle default privileges. It doesn't touch regular privileges either, but only the latter was explicitly stated. Discussion: https://postgr.es/m/155348282848.9808.12629518043813943...@wrigleys.postgresql.org Branch -- REL9_6_STABLE Details ---

pgsql: Doc: clarify that REASSIGN OWNED doesn't handle default privileg

2019-03-25 Thread Tom Lane
Doc: clarify that REASSIGN OWNED doesn't handle default privileges. It doesn't touch regular privileges either, but only the latter was explicitly stated. Discussion: https://postgr.es/m/155348282848.9808.12629518043813943...@wrigleys.postgresql.org Branch -- REL_10_STABLE Details ---

pgsql: Doc: clarify that REASSIGN OWNED doesn't handle default privileg

2019-03-25 Thread Tom Lane
Doc: clarify that REASSIGN OWNED doesn't handle default privileges. It doesn't touch regular privileges either, but only the latter was explicitly stated. Discussion: https://postgr.es/m/155348282848.9808.12629518043813943...@wrigleys.postgresql.org Branch -- REL9_5_STABLE Details ---

pgsql: Improve planner's selectivity estimates for inequalities on CTID

2019-03-25 Thread Tom Lane
Improve planner's selectivity estimates for inequalities on CTID. We were getting just DEFAULT_INEQ_SEL for comparisons such as "ctid >= constant", but it's possible to do a lot better if we don't mind some assumptions about the table's tuple density being reasonably uniform. There are already as

pgsql: Add MacPorts support to src/test/ldap tests.

2019-03-25 Thread Thomas Munro
Add MacPorts support to src/test/ldap tests. Previously the test knew how to find an OpenLDAP installation at the paths used by Homebrew. Add the MacPorts paths too. Author: Thomas Munro Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CA%2BhUKGKrjGS7sO4jc53gp3qipCtEvThtdP_%3DzoixgX5ZBq4Nb

pgsql: tableam: Add helper for indexes to check if a corresponding tabl

2019-03-25 Thread Andres Freund
tableam: Add helper for indexes to check if a corresponding table tuples exist. This is, likely exclusively, useful to verify that conflicts detected in a unique index are with live tuples, rather than dead ones. Author: Andres Freund Discussion: https://postgr.es/m/20180703070645.wchpu5muyto5n.

pgsql: tableam: Add table_get_latest_tid, to wrap heap_get_latest_tid.

2019-03-25 Thread Andres Freund
tableam: Add table_get_latest_tid, to wrap heap_get_latest_tid. This primarily is to allow WHERE CURRENT OF to continue to work as it currently does. It's not clear to me that these semantics make sense for every AM, but it works for the in-core heap, and the out of core zheap. We can refine it fu

Re: pgsql: tableam: Add helper for indexes to check if a corresponding tabl

2019-03-25 Thread Peter Geoghegan
On Mon, Mar 25, 2019 at 5:34 PM Andres Freund wrote: > tableam: Add helper for indexes to check if a corresponding table tuples > exist. > > This is, likely exclusively, useful to verify that conflicts detected > in a unique index are with live tuples, rather than dead ones. Any reason why you d

Re: pgsql: tableam: Add helper for indexes to check if a corresponding tabl

2019-03-25 Thread Andres Freund
Hi, On 2019-03-25 17:47:17 -0700, Peter Geoghegan wrote: > On Mon, Mar 25, 2019 at 5:34 PM Andres Freund wrote: > > tableam: Add helper for indexes to check if a corresponding table tuples > > exist. > > > > This is, likely exclusively, useful to verify that conflicts detected > > in a unique in

Re: pgsql: tableam: Add helper for indexes to check if a corresponding tabl

2019-03-25 Thread Peter Geoghegan
On Mon, Mar 25, 2019 at 6:00 PM Andres Freund wrote: > Hm. Fair question. I guess if there's any potential external users of > it, they'd likely need to make v12 adjustments anyway? I'm not sure that they'd need to make adjustments. I think it's unlikely that there are any external users, though

pgsql: Fix crash when using partition bound expressions

2019-03-25 Thread Michael Paquier
Fix crash when using partition bound expressions Since 7c079d7, partition bounds are able to use generalized expression syntax when processed, treating "minvalue" and "maxvalue" as specific cases as they get passed down for transformation as a column references. The checks for infinite bounds in

Re: pgsql: tableam: Add helper for indexes to check if a corresponding tabl

2019-03-25 Thread Andres Freund
Hi, On 2019-03-25 18:02:59 -0700, Peter Geoghegan wrote: > On Mon, Mar 25, 2019 at 6:00 PM Andres Freund wrote: > > Hm. Fair question. I guess if there's any potential external users of > > it, they'd likely need to make v12 adjustments anyway? > > I'm not sure that they'd need to make adjustme

pgsql: Remove heap_hot_search().

2019-03-25 Thread Andres Freund
Remove heap_hot_search(). After 71bdc99d0d7, "tableam: Add helper for indexes to check if a corresponding table tuples exist." there's no in-core user left. As there's unlikely to be an external user, and such an external user could easily be adjusted to use table_index_fetch_tuple_check(), remove