Re: Add RANGE with values and exclusions clauses to the Window Functions

2018-01-09 Thread Tom Lane
Oliver Ford writes: > On Tuesday, 9 January 2018, Tom Lane wrote: >> So the approach I'm imagining now is a datatype-specific support function >> along the lines of >> in_range(a, b, delta) returns bool >> Likely there are two of these, one each for the PRECEDING and FOLLOWING >> cases. > W

Re: Add RANGE with values and exclusions clauses to the Window Functions

2018-01-09 Thread Oliver Ford
On Tuesday, 9 January 2018, Tom Lane wrote: > > So the approach I'm imagining now is a datatype-specific support function > along the lines of > > in_range(a, b, delta) returns bool > > which is supposed to return true if a <= b + delta, or something along > that line --- exact details of

Re: [HACKERS] SQL/JSON in PostgreSQL

2018-01-09 Thread Oleg Bartunov
On 9 Jan 2018 23:44, "Andrew Dunstan" wrote: On 01/02/2018 05:23 PM, Andrew Dunstan wrote: > > On 01/02/2018 05:04 PM, Nikita Glukhov wrote: >> I have removed all extra features from the patch set, they can be >> found in our >> github repository: >> https://github.com/postgrespro/sqljson/tree/

Re: Optimize Arm64 crc32c implementation in Postgresql

2018-01-09 Thread Michael Paquier
On Wed, Jan 10, 2018 at 05:58:19AM +, Yuqi Gu wrote: > I would like to propose the patch to optimize crc32c calculation with > Arm64 specific instructions. The hardware-specific code > implementation is used under #if defined > USE_ARMCE_CRC32C_WITH_RUNTIME_CHECK. And the performance is improve

Optimize Arm64 crc32c implementation in Postgresql

2018-01-09 Thread Yuqi Gu
Hi all Currently PostgreSQL only implements hardware support for CRC32 checksums for the x86_64 architecture. Some ARMv8 (AArch64) CPUs implement the CRC32 extension which is implemented by inline assembly, so they can also benefit from hardware acceleration in IO-intensive workloads. I would l

Re: [HACKERS] PATCH: psql tab completion for SELECT

2018-01-09 Thread Edmund Horner
Hi Vik, thanks so much for the comments and the offer to review! I kept a low profile after my first message as there was already a commitfest in progress, but now I'm working on a V2 patch. I will include aggregate and window functions as you suggest. And I'll exclude trigger functions. I'd li

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-09 Thread Haribabu Kommi
On Tue, Jan 9, 2018 at 12:15 PM, Michael Paquier wrote: > On Fri, Jan 05, 2018 at 09:15:36AM -0300, Alvaro Herrera wrote: > > Haribabu Kommi wrote: > > > > > And also not returning "default host" details, because for the conninfo > > > without any host details, the return value must be NULL. But

Re: Rangejoin rebased

2018-01-09 Thread Jeff Davis
On Sat, Jan 6, 2018 at 10:38 AM, Simon Riggs wrote: > For this to be useful, it needs to include some details of how to use > it when people have NOT used range datatypes in their tables. Good idea. I added an example that doesn't have range types in the base table. > If we can see some examples

Re: [HACKERS] path toward faster partition pruning

2018-01-09 Thread David Rowley
On 9 January 2018 at 21:40, Amit Langote wrote: > Sorry about the absence in the last few days. I will post a new version > addressing various review comments by the end of this week. I'm sorry for the flood of emails today. Beena's tests on the run-time partition pruning patch also indirectly

Re: [HACKERS] SQL/JSON in PostgreSQL

2018-01-09 Thread Pavel Stehule
2018-01-09 21:44 GMT+01:00 Andrew Dunstan : > > > On 01/02/2018 05:23 PM, Andrew Dunstan wrote: > > > > On 01/02/2018 05:04 PM, Nikita Glukhov wrote: > >> I have removed all extra features from the patch set, they can be > >> found in our > >> github repository: > >> https://github.com/postgrespro

Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)

2018-01-09 Thread Thomas Munro
On Sat, Jan 6, 2018 at 11:17 AM, Peter Geoghegan wrote: > * Significant overhaul of tuplesort.h contract. This had references to > the old approach, and to tqueue.c's tuple descriptor thing that was > since superseded by the typmod registry added for parallel hash join. > These were updated/remove

Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)

2018-01-09 Thread Peter Geoghegan
On Mon, Jan 8, 2018 at 9:44 PM, Rushabh Lathia wrote: > I gone through the changes and perform the basic testing. Changes > looks good and haven't found any unusual during testing Then I'll mark the patch "Ready for Committer" now. I think that we've done just about all we can with it. There is

Re: BUG #14941: Vacuum crashes

2018-01-09 Thread Michael Paquier
On Tue, Jan 09, 2018 at 01:46:55PM -0800, Andres Freund wrote: > On 2018-01-09 10:23:12 -0500, Robert Haas wrote: > > On Mon, Jan 8, 2018 at 11:27 PM, Michael Paquier > > wrote: > > > On Thu, Dec 28, 2017 at 10:46:18PM +, Bossart, Nathan wrote: > > >> I agree, this makes more sense. I've made

Re: BUG #14941: Vacuum crashes

2018-01-09 Thread Michael Paquier
On Tue, Jan 09, 2018 at 09:40:50PM +, Bossart, Nathan wrote: > On 1/8/18, 10:28 PM, "Michael Paquier" wrote: >> I think that you are doing it wrong here. In get_all_vacuum_rels() you >> should build a RangeVar to be reused in the context of this error >> message, and hence you'll save an extra

Re: [HACKERS] GUC for cleanup indexes threshold.

2018-01-09 Thread Masahiko Sawada
On Sun, Jan 7, 2018 at 8:40 AM, Peter Geoghegan wrote: > On Sat, Jan 6, 2018 at 2:20 PM, Stephen Frost wrote: >>> > IIRC the patches that makes the cleanup scan skip has a problem >>> > pointed by Peter[1], that is that we stash an XID when a btree page is >>> > deleted, which is used to determin

Re: [HACKERS] path toward faster partition pruning

2018-01-09 Thread David Rowley
On 9 January 2018 at 21:40, Amit Langote wrote: > Sorry about the absence in the last few days. I will post a new version > addressing various review comments by the end of this week. One more thing I discovered while troubleshooting a bug Beena reported in the run-time partition pruning patch i

Re: [HACKERS] Runtime Partition Pruning

2018-01-09 Thread David Rowley
On Tue, Jan 9, 2018 at 2:24 PM, Beena Emerson wrote: > prepare abc_q1 (int, int, char) as select * from ab_c where a BETWEEN > $1 and $2 AND b <= $3; > > --after 5 runs: abc_a2_b3 is not pruned. This seems to be down to an existing bug. I'm not yet sure if it's caused by faster_partition_prune_v1

Re: pgsql: Implement channel binding tls-server-end-point for SCRAM

2018-01-09 Thread Michael Paquier
On Tue, Jan 09, 2018 at 12:49:11PM -0500, Peter Eisentraut wrote: > Committed. I like counter-patches. > > (I renamed the function a bit to check_pg_config, to make the naming > similar to other functions in TestLib.) Thanks for committing. I think that you should have authorship as well, which

Re: [HACKERS] [PATCH] Assert that the correct locks are held when calling PageGetLSN()

2018-01-09 Thread Michael Paquier
On Tue, Jan 09, 2018 at 05:19:00PM -0300, Alvaro Herrera wrote: > Alvaro Herrera wrote: > So ... gistdoinsert can sometimes hold an exclusive lock, so we could do > this instead: > > diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c > index 0e499598a4..2ea19d2683 100644 >

Re: [HACKERS] dead or outdated URLs found in win32.h

2018-01-09 Thread Ashutosh Sharma
On Jan 10, 2018 05:03, "Bruce Momjian" wrote: On Sat, Oct 7, 2017 at 10:31:17AM +0530, Ashutosh Sharma wrote: > Hi All, > > The following URLs present in src/include/port/win32.h to share the > information on dllimport or dllexport (used in windows) seems to be > either dead/obsolete and i think

Re: [HACKERS] [POC] Faster processing at Gather node

2018-01-09 Thread Andres Freund
Hi, On 2017-12-04 10:50:53 -0500, Robert Haas wrote: > Subject: [PATCH 1/2] shm-mq-less-spinlocks-v2 > + * mq_sender and mq_bytes_written can only be changed by the sender. > + * mq_receiver and mq_sender are protected by mq_mutex, although, > importantly, > + * they cannot change once set, and

Re: Add RANGE with values and exclusions clauses to the Window Functions

2018-01-09 Thread Tom Lane
Vik Fearing writes: > I'm -1 on such a patch, even though I would really like this feature. For the record, I'd really like to get this feature in too (and am willing to help) ... but it needs to be done right. regards, tom lane

Re: Add RANGE with values and exclusions clauses to the Window Functions

2018-01-09 Thread Vik Fearing
On 01/09/2018 10:59 PM, Tom Lane wrote: > Generally speaking, Postgres tries hard to be an extensible-datatype > system, going beyond the SQL standard's minimum requirements when > necessary to make it so. The reason that we don't already have RANGE > PRECEDING/FOLLOWING support is that nobody was

Re: [HACKERS] dead or outdated URLs found in win32.h

2018-01-09 Thread Bruce Momjian
On Sat, Oct 7, 2017 at 10:31:17AM +0530, Ashutosh Sharma wrote: > Hi All, > > The following URLs present in src/include/port/win32.h to share the > information on dllimport or dllexport (used in windows) seems to be > either dead/obsolete and i think, they need to be updated. > > http://support.

Re: [HACKERS] Runtime Partition Pruning

2018-01-09 Thread David Rowley
On 9 January 2018 at 22:22, Beena Emerson wrote: > ERROR: operator 1057 is not a member of opfamily 1976 Thanks for finding these. I'm looking into the above, and the other ones you've mentioned now. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 S

Re: [HACKERS] path toward faster partition pruning

2018-01-09 Thread David Rowley
On 9 January 2018 at 21:40, Amit Langote wrote: > Sorry about the absence in the last few days. I will post a new version > addressing various review comments by the end of this week. Good to have you back. There's a small problem with get_partitions_for_keys_list(), the following case hits the

Re: Expression based grouping equality implementation

2018-01-09 Thread Andres Freund
Hi, On 2017-11-29 00:09:34 -0800, Andres Freund wrote: > Similar to [1] (Expression based aggregate transition / combine function > invocation), this patch provides small-medium performance benefits in > order to later enable larger performance benefits with JIT compilation. Here's an updated ver

Re: [HACKERS] Removing LEFT JOINs in more cases

2018-01-09 Thread David Rowley
On 10 January 2018 at 08:44, Tom Lane wrote: > I'll set the patch back to Waiting on Author. Many thanks for looking at this. I'll try to resolve the things you've mentioned this coming weekend. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support

Re: [HACKERS] Removing useless DISTINCT clauses

2018-01-09 Thread David Rowley
Hi Tom, Thanks for looking at this. On 10 January 2018 at 09:26, Tom Lane wrote: > This is a cute idea, but I'm troubled by a couple of points: > > 1. Once you don't have all the tlist items shown in DISTINCT, it really is > more like DISTINCT ON, seems like. I am not sure it's a good idea to s

[no subject]

2018-01-09 Thread Tom Lane
Walter Cai writes: > Sorry about not including a title at first, I completely forgot! > And thanks for the help, Tom. With respect to the Var: I'm really just > hoping to access the column name Well, you could look that up from the catalogs, or maybe better pull it out of the alias list for the V

Re: [HACKERS] pgbench more operators & functions

2018-01-09 Thread Tom Lane
Teodor Sigaev writes: > Thank you, pushed Some of the Windows buildfarm members aren't too happy with this. regards, tom lane

Re: Add RANGE with values and exclusions clauses to the Window Functions

2018-01-09 Thread Tom Lane
Oliver Ford writes: > [ 0001-window-frame-v6.patch ] Generally speaking, Postgres tries hard to be an extensible-datatype system, going beyond the SQL standard's minimum requirements when necessary to make it so. The reason that we don't already have RANGE PRECEDING/FOLLOWING support is that nob

Re: BUG #14941: Vacuum crashes

2018-01-09 Thread Andres Freund
On 2018-01-09 10:23:12 -0500, Robert Haas wrote: > On Mon, Jan 8, 2018 at 11:27 PM, Michael Paquier > wrote: > > On Thu, Dec 28, 2017 at 10:46:18PM +, Bossart, Nathan wrote: > >> I agree, this makes more sense. I've made this change in v3 of 0003. > > > > Based on the opinions gathered on thi

Re: BUG #14941: Vacuum crashes

2018-01-09 Thread Bossart, Nathan
On 1/9/18, 9:24 AM, "Robert Haas" wrote: > On Mon, Jan 8, 2018 at 11:27 PM, Michael Paquier > wrote: >> On Thu, Dec 28, 2017 at 10:46:18PM +, Bossart, Nathan wrote: >>> I agree, this makes more sense. I've made this change in v3 of 0003. >> >> Based on the opinions gathered on this thread, 0

Re: BUG #14941: Vacuum crashes

2018-01-09 Thread Bossart, Nathan
On 1/8/18, 10:28 PM, "Michael Paquier" wrote: > Based on the opinions gathered on this thread, 0001 and 0002 seem to be > in the shape wanted, and those look good for shipping. Now for 0003 we > are not there yet. Thanks for taking a look. > - if (relation == NULL) > + if (relation !

Re: [HACKERS] UPDATE of partition key

2018-01-09 Thread Robert Haas
On Fri, Jan 5, 2018 at 3:25 PM, Robert Haas wrote: > On Fri, Jan 5, 2018 at 7:12 AM, Amit Khandekar wrote: >> The above patch is to be applied over the last remaining preparatory >> patch, now named (and attached) : >> 0001-Refactor-CheckConstraint-related-code.patch > > Committed that one, too.

Re:

2018-01-09 Thread Walter Cai
Sorry about not including a title at first, I completely forgot! And thanks for the help, Tom. With respect to the Var: I'm really just hoping to access the column name Best, Walter On Tue, Jan 9, 2018 at 11:14 AM, Tom Lane wrote: > Walter Cai writes: > > I (a graduate student) am currently t

Re: improve type conversion of SPI_processed in Python

2018-01-09 Thread Tom Lane
Peter Eisentraut writes: > Here is a patch to improves how PL/Python deals with very large values > of SPI_processed. The previous code converts anything that does not fit > into a C long into a Python float. But Python long has unlimited > precision, so we should be using that instead. And in

Re: [HACKERS] SQL/JSON in PostgreSQL

2018-01-09 Thread Andrew Dunstan
On 01/02/2018 05:23 PM, Andrew Dunstan wrote: > > On 01/02/2018 05:04 PM, Nikita Glukhov wrote: >> I have removed all extra features from the patch set, they can be >> found in our >> github repository: >> https://github.com/postgrespro/sqljson/tree/sqljson_ext. >> >> Now there are 10 patches whi

Re: Add %r substitution for psql prompts to show recovery status

2018-01-09 Thread Peter Eisentraut
On 12/7/17 19:54, Tatsuo Ishii wrote: >> On Wed, Dec 6, 2017 at 9:19 PM, Ian Barwick >> wrote: >>> Note this substitution sends a "pg_is_in_recovery()" query to the server >>> each time it's encountered; unless there's something I'm overlooking I >>> think that's the only reliable way to determin

Re: [HACKERS] Removing useless DISTINCT clauses

2018-01-09 Thread Tom Lane
David Rowley writes: > [ remove_useless_distinct_clauses_v2.patch ] This is a cute idea, but I'm troubled by a couple of points: 1. Once you don't have all the tlist items shown in DISTINCT, it really is more like DISTINCT ON, seems like. I am not sure it's a good idea to set hasDistinctOn, bec

Re: [HACKERS] [PATCH] Assert that the correct locks are held when calling PageGetLSN()

2018-01-09 Thread Alvaro Herrera
Alvaro Herrera wrote: > Pushed 0001. I marked the CF entry as "committed", BTW. I assume you're going to ship an updated version of 0002 to the next commitfest. If you have a new version during this commitfest, feel free to turn this entry back to "needs review". -- Álvaro Herrera

Re: [HACKERS] [PATCH] Assert that the correct locks are held when calling PageGetLSN()

2018-01-09 Thread Alvaro Herrera
Pushed 0001. I confirm the finding that 0002 makes TestForOldSnapshot blow up. I suppose the right fix is to pass the buffer, not just the page, rather than trying to reverse-engineer the buffer from the page. Regarding adding the proposed checks, which I think we should clearly do, my preferred

Re: General purpose hashing func in pgbench

2018-01-09 Thread Fabien COELHO
Hello Ildar, Sorry for a long delay. I've added hash() function which is just an alias for murmur2. I've also utilized variable arguments feature from least()/greates() functions to make optional seed parameter, but I consider this as a hack. Patch needs a rebase after Teodor push for a set o

Re: [HACKERS] Removing LEFT JOINs in more cases

2018-01-09 Thread Tom Lane
David Rowley writes: > [ remove_left_join_distinct_2017-11-30.patch ] I looked at this, and it seems like an interesting idea, but I'm unconvinced that the specific conditions here are OK. One clear problem is that you consider a DISTINCT to be an automatic get-out-of-jail-free card, but that do

Re: to_timestamp TZH and TZM format specifiers

2018-01-09 Thread Andrew Dunstan
On 01/09/2018 01:57 PM, Pavel Stehule wrote: > > > 2018-01-09 19:52 GMT+01:00 Andrew Dunstan > mailto:andrew.duns...@2ndquadrant.com>>: > > > > On 01/09/2018 01:46 PM, Pavel Stehule wrote: > > > > > > I checked this patch and I think so it is correct. > > > > 1. all tests

Re:

2018-01-09 Thread Tom Lane
Walter Cai writes: > I (a graduate student) am currently trying to modify a postgres instance > slightly to incorporate my modified cardinality estimates. In order to run > these experiments I'm hoping to access the raw values for selections > predicates from within the calc_joinrel_size_estimate

Re:

2018-01-09 Thread Gavin Flower
On 10/01/18 07:52, Walter Cai wrote: Hi, I (a graduate student) am currently trying to modify a postgres instance slightly to incorporate my modified cardinality estimates. In order to run these experiments I'm hoping to access the raw values for selections predicates from within the calc_joi

Re: update portal-related memory context names and API

2018-01-09 Thread Peter Eisentraut
On 1/8/18 15:30, Andrew Dunstan wrote: > On 12/19/2017 12:31 PM, Peter Eisentraut wrote: >> ISTM that some of the portal-related memory context naming is a bit >> antiquated and at odds with current terminology. In this patch, I >> propose to rename PortalMemory to TopPortalContext and rename >> P

Re: [HACKERS] pgbench more operators & functions

2018-01-09 Thread Fabien COELHO
Thank you, pushed Thanks! -- Fabien.

Re: to_timestamp TZH and TZM format specifiers

2018-01-09 Thread Pavel Stehule
2018-01-09 19:52 GMT+01:00 Andrew Dunstan : > > > On 01/09/2018 01:46 PM, Pavel Stehule wrote: > > > > > > I checked this patch and I think so it is correct. > > > > 1. all tests passed > > 2. no problems with patching and compilation > > 3. the doc is good enough > > 4. I can confirm so Oracle 12

[no subject]

2018-01-09 Thread Walter Cai
Hi, I (a graduate student) am currently trying to modify a postgres instance slightly to incorporate my modified cardinality estimates. In order to run these experiments I'm hoping to access the raw values for selections predicates from within the calc_joinrel_size_estimate method (in costsize.c).

Re: to_timestamp TZH and TZM format specifiers

2018-01-09 Thread Andrew Dunstan
On 01/09/2018 01:46 PM, Pavel Stehule wrote: > > > I checked this patch and I think so it is correct. > > 1. all tests passed > 2. no problems with patching and compilation > 3. the doc is good enough > 4. I can confirm so Oracle 12c supports these formats, but I have not > possibility to test it

Re: to_timestamp TZH and TZM format specifiers

2018-01-09 Thread Pavel Stehule
2018-01-09 19:46 GMT+01:00 Pavel Stehule : > Hi > > 2018-01-08 1:22 GMT+01:00 Nikita Glukhov : > >> On 03.01.2018 21:34, Tom Lane wrote: >> >> Andrew Dunstan writes: >>> This small and simple standalone patch extracted from the SQL/JSON work would allow the user to supply a string with

Re: to_timestamp TZH and TZM format specifiers

2018-01-09 Thread Pavel Stehule
Hi 2018-01-08 1:22 GMT+01:00 Nikita Glukhov : > On 03.01.2018 21:34, Tom Lane wrote: > > Andrew Dunstan writes: >> >>> This small and simple standalone patch extracted from the SQL/JSON work >>> would allow the user to supply a string with a time zone specified as >>> hh:mm thus: >>> SELECT

Re: [HACKERS] [PATCH] Assert that the correct locks are held when calling PageGetLSN()

2018-01-09 Thread Alvaro Herrera
So ... gistdoinsert can sometimes hold an exclusive lock, so we could do this instead: diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c index 0e499598a4..2ea19d2683 100644 --- a/src/backend/access/gist/gist.c +++ b/src/backend/access/gist/gist.c @@ -566,7 +566,8 @@ gist

Re: pgsql: Implement channel binding tls-server-end-point for SCRAM

2018-01-09 Thread Peter Eisentraut
On 1/8/18 08:14, Michael Paquier wrote: > On Sat, Jan 06, 2018 at 09:10:51AM +0900, Michael Paquier wrote: >> On Sat, Jan 6, 2018 at 2:56 AM, Alvaro Herrera >> wrote: >> Good idea as a whole, but I don't think this is the right approach. As >> we include $(bindir) in PATH when running the prove c

Re: [HACKERS] UPDATE of partition key

2018-01-09 Thread Robert Haas
On Thu, Jan 4, 2018 at 1:18 AM, Amit Khandekar wrote: > -- > 1. ExecUpdate() needs to revert back tcs_map value changed by ExecInsert() > -- > >>> It seems like the ON CONFLICT stuff handled that by adding a >>> second TransitionCaptureState pointer to ModifyTable,

Re: [HACKERS] Secondary index access optimizations

2018-01-09 Thread Antonin Houska
Konstantin Knizhnik wrote: > On 14.08.2017 19:33, Konstantin Knizhnik wrote: > > On 14.08.2017 12:37, Konstantin Knizhnik wrote: > > Hi hackers, > > I am trying to compare different ways of optimizing work with huge > append-only tables in PostgreSQL where primary key is something like

Re: General purpose hashing func in pgbench

2018-01-09 Thread Ildar Musin
Hello Fabien, 25/12/2017 19:17, Fabien COELHO пишет: > >>> However, the key can be used if controlled so that different values do >>> not have the same randomization in different part of the script, so as >>> to avoid using the same patterns for different things if not desirable. >> >> Original m

Re: [HACKERS] PATCH: psql tab completion for SELECT

2018-01-09 Thread Vik Fearing
On 11/06/2017 05:28 AM, Edmund Horner wrote: > Hi pgsql-hackers, > > Here's a little draft patch to add *some* tab completion ability for > SELECT in psql. I have often missed the ability, especially with > invocations of utility functions. Yes, indeed! The vast majority of what I use interacti

Re: BUG #14941: Vacuum crashes

2018-01-09 Thread Robert Haas
On Mon, Jan 8, 2018 at 11:27 PM, Michael Paquier wrote: > On Thu, Dec 28, 2017 at 10:46:18PM +, Bossart, Nathan wrote: >> I agree, this makes more sense. I've made this change in v3 of 0003. > > Based on the opinions gathered on this thread, 0001 and 0002 seem to be > in the shape wanted, and

Re: [HACKERS] pgbench more operators & functions

2018-01-09 Thread Teodor Sigaev
Thank you, pushed Fabien COELHO wrote: SQL doesn't evaluate unneeded arguments: Here is a version with some lazy evaluation for and, or & case. v23 is a rebase. -- Teodor Sigaev E-mail: teo...@sigaev.ru

Re: [HACKERS] Transactions involving multiple postgres foreign servers

2018-01-09 Thread Masahiko Sawada
On Tue, Jan 9, 2018 at 11:38 PM, Robert Haas wrote: > On Wed, Dec 27, 2017 at 9:40 PM, Tsunakawa, Takayuki > wrote: >> (1) >> Why don't you use the existing global variable MyXactFlags instead of the >> new TransactionDidWrite? Or, how about using XactLastRecEnd != 0 to >> determine the transa

Re: Incorrect comment for expand_single_inheritance_child

2018-01-09 Thread Robert Haas
On Mon, Jan 8, 2018 at 10:37 PM, Etsuro Fujita wrote: > Attached is a patch for that. Committed. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: [HACKERS] Transactions involving multiple postgres foreign servers

2018-01-09 Thread Robert Haas
On Wed, Dec 27, 2017 at 9:40 PM, Tsunakawa, Takayuki wrote: > (1) > Why don't you use the existing global variable MyXactFlags instead of the new > TransactionDidWrite? Or, how about using XactLastRecEnd != 0 to determine > the transaction did any writes? When the transaction only modified tem

Re: pgbench - add \if support

2018-01-09 Thread Fabien COELHO
Hello Vik, This patch adds a \if construct so that an expression on variables, possibly with data coming from the database, can change the behavior of a script. I have given this patch a pretty good shake and I'm happy with it. I did not test it with the other two patches, only on its own.

Re: pgbench - add \if support

2018-01-09 Thread Vik Fearing
On 11/25/2017 10:33 PM, Fabien COELHO wrote: > > This patch adds \if support to pgbench, similar to psql's version added > in March. > > This patch brings a consistent set of features especially when combined > with two other patches already in the (slow) CF process: > >  - https://commitfest.po

Re: pgbench - add \if support

2018-01-09 Thread Fabien COELHO
Hello Dmitry, What you are trying to do is the result of combining the pgbench-if patch and the pgbench-more-ops-and-funcs patch. Oh, I see. I missed the first message about this patch, sorry. But for some reason I can't apply both patches (pgbench-more-ops-funcs-23.patch and pgbench-if-4.pat

Re: Re: [HACKERS] pgbench randomness initialization

2018-01-09 Thread Fabien COELHO
Hello Chapman, Thanks for the review, The tests assume that stdlib random/srandom behavior is standard thus deterministic between platform. Is the behavior of srandom() and the system generator really so precisely specified that seed 5432 will produce the same values hardcoded in the tests o

Re: proposal: alternative psql commands quit and exit

2018-01-09 Thread Vik Fearing
On 01/09/2018 02:29 AM, Alvaro Herrera wrote: > Everaldo Canuto wrote: >> Change my patch will make psql different from other sql clients I use >> (sqlplus and mysql). > > Well, I don't think we're too hot about copying their behavior exactly. > This thread discussed the behavior at length and a c

Re: to_typemod(type_name) information function

2018-01-09 Thread Arthur Zakirov
Hello, On Tue, Nov 21, 2017 at 06:23:43PM +0100, Sophie Herold wrote: > > I did not find any advice on how to choose a new OID for pg_proc. > Just two cents in addition to Stephen's and Tom's answers. You can choose a new Oid using unused_oids script. Just do the following: $ cd src/include/c

Re: [HACKERS] WIP Patch: Precalculate stable functions, infrastructure v1

2018-01-09 Thread Marina Polyakova
Thanks for your patch, looks quite interesting! Glad to hear it :) To not send big patch I have split it (that's why version starts with the first again) and here I send infrastructure patch which includes: Yeah, but it's still 18k lines :) Here 13k lines - 2 sets of expected results for

Re: pgbench - add \if support

2018-01-09 Thread Dmitry Dolgov
> On 8 January 2018 at 19:36, Fabien COELHO wrote: > What you are trying to do is the result of combining the pgbench-if patch > and the pgbench-more-ops-and-funcs patch. Oh, I see. I missed the first message about this patch, sorry. But for some reason I can't apply both patches (pgbench-more-o

Re: Multi-level hierarchy with parallel append can lead to an extra subplan.

2018-01-09 Thread Amit Khandekar
Thanks Rajkumar for catching this. There is indeed is an extra child subplan showing up in the Parallel Append : -> Parallel Append -> Seq Scan on rm38941_inherit_t1 -> Parallel Seq Scan on rm38941_inherit

Re: PL/Python SD dict wiped?

2018-01-09 Thread David Gould
On Mon, 8 Jan 2018 14:24:42 -0500 Peter Eisentraut wrote: > On 1/8/18 11:59, Ken Huffman wrote: > > I'm fine with per-session initializing of prepared statements, but is > > there PL/Python mechanism that spans sessions to minimize ConfigParser > > calls? > > Nothing built-in. You would have

Multi-level hierarchy with parallel append can lead to an extra subplan.

2018-01-09 Thread Rajkumar Raghuwanshi
Hi, I am getting extra subplan when using parallel append with multi-level hierarchy, leading to data corruption. Please see below test case. -- set below parameters to encourage use of parallel plans SET parallel_setup_cost=0; SET parallel_tuple_cost=0; SET min_parallel_table_scan_size=0; SET m

Re: [HACKERS] Runtime Partition Pruning

2018-01-09 Thread Beena Emerson
Hi, The mail was accidently sent before I could complete. On Tue, Jan 9, 2018 at 2:24 PM, Beena Emerson wrote: > Hello, > > The pruning does not work well with char type: > > Case 2: Case with optimizer pruning > drop table ab_c; > create table ab_c (a int not null, b int) partition by list(a);

Re: Failed to delete old ReorderBuffer spilled files

2018-01-09 Thread atorikoshi
On 2018/01/06 0:30, Alvaro Herrera wrote: Ahh, so the reason I didn't see these crashes is that Atsushi had already fixed them. Nice. It would be *very* good to trim the quoted material when you reply --- don't leave everything, just enough lines for context. I would have seen this comment if

Re: pgbench randomness initialization

2018-01-09 Thread Chapman Flack
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: not tested Documentation:not tested Initial review is the message this is in reply to. The new status of

Re: Re: [HACKERS] pgbench randomness initialization

2018-01-09 Thread Chapman Flack
On 01/02/18 05:57, Fabien COELHO wrote: >> Here is a new version which output use used seed when a seed is >> explicitely set with an option or from the environment. This is a simple patch that does what it says on the tin. I ran into trouble with the pgbench TAP test *even before applying the pa

Re: [HACKERS] Runtime Partition Pruning

2018-01-09 Thread Beena Emerson
Hello, On Sun, Jan 7, 2018 at 5:31 PM, David Rowley wrote: > On 7 January 2018 at 00:03, David Rowley wrote: >> I've fixed this in the attached, but I did so by calling >> adjust_appendrel_attrs() from the nodeAppend.c, which did, of course, >> mean that the AppendRelInfo needed to be given to t

Re: [PROPOSAL] Shared Ispell dictionaries

2018-01-09 Thread Arthur Zakirov
Thank you for your answer. On Mon, Jan 08, 2018 at 06:12:37PM +0100, Tomas Vondra wrote: > > I believe Pavel was referring to this extension: > > https://github.com/tvondra/shared_ispell > Oh, understood. > I wasn't going to submit that as in-core solution, but I'm happy you're > making i

Re: [HACKERS] path toward faster partition pruning

2018-01-09 Thread Amit Langote
On 2018/01/05 1:28, Alvaro Herrera wrote: >> From 8d627b910278203151853d324c3319c265cd36c0 Mon Sep 17 00:00:00 2001 >> From: amit >> Date: Tue, 22 Aug 2017 13:48:13 +0900 >> Subject: [PATCH 2/5] Introduce a get_partitions_from_clauses() > > This one fails to apply. Please rebase. Sorry about th

Re: User defined data types in Logical Replication

2018-01-09 Thread Masahiko Sawada
On Sat, Jan 6, 2018 at 3:53 AM, Alvaro Herrera wrote: > hash_seq_init in logicalrep_typmap_invalidate_cb is useless after your > patch. If you remove it, the function becomes empty, so why is it there > an invalidation callback at all? Thank you for the comment. Yeah, logicalrep_typmap_invalidat

RE: [HACKERS] Statement-level rollback

2018-01-09 Thread Tsunakawa, Takayuki
From: Simon Riggs [mailto:si...@2ndquadrant.com] > When will the next version be posted? I'm very sorry I haven't submitted anything. I'd like to address this during this CF. Thanks for remembering this. Regards Takayuki Tsunakawa