Re: Why we allow CHECK constraint contradiction?

2018-10-09 Thread Corey Huinker
On Wed, Oct 10, 2018 at 1:44 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Tuesday, October 9, 2018, Imai, Yoshikazu < > imai.yoshik...@jp.fujitsu.com> wrote: >> >> Are there any rows which can satisfy the ct's CHECK constraint? If not, >> why we >> allow creating table when

Re: Why we allow CHECK constraint contradiction?

2018-10-09 Thread David G. Johnston
On Tuesday, October 9, 2018, Imai, Yoshikazu wrote: > > Are there any rows which can satisfy the ct's CHECK constraint? If not, > why we > allow creating table when check constraint itself is contradicted? > I'd bet on it being a combination of complexity and insufficient expected benefit. Time

Why we allow CHECK constraint contradiction?

2018-10-09 Thread Imai, Yoshikazu
Hi, all. I have a wonder about the behaviour of creating table which has a constraint contradiction. I created below table. bugtest=# create table ct (a int, CHECK(a is not null and a >= 0 and a < 100 and a >= 200 and a < 300)); bugtest=# \d+ ct Table

Re: [HACKERS] Transactions involving multiple postgres foreign servers, take 2

2018-10-09 Thread Masahiko Sawada
On Wed, Oct 3, 2018 at 6:02 PM Chris Travers wrote: > > > > On Wed, Oct 3, 2018 at 9:41 AM Chris Travers wrote: >> >> The following review has been posted through the commitfest application: >> make installcheck-world: tested, failed >> Implements feature: not tested >> Spec compliant:

Re: partition tree inspection functions

2018-10-09 Thread Michael Paquier
On Wed, Oct 10, 2018 at 11:54:48AM +0900, Amit Langote wrote: > I was partly wrong in saying that we wouldn't need any changes to support > partitioned indexes here. Actually, the core function > find_inheritance_children wouldn't scan pg_inherits for us if we pass an > (partitioned) index to it,

Re: background worker shudown (was Re: [HACKERS] Why does logical replication launcher exit with exit code 1?)

2018-10-09 Thread Thomas Munro
On Wed, Oct 10, 2018 at 7:29 AM Robert Haas wrote: > On Thu, Oct 4, 2018 at 7:37 PM Thomas Munro > wrote: > > 0. The default SIGTERM handler for bgworkers is bgworker_die(), which > > generates a FATAL ereport "terminating background worker \"%s\" due to > > administrator command", directly in

Re: partition tree inspection functions

2018-10-09 Thread Amit Langote
On 2018/10/09 20:17, Michael Paquier wrote: > On Tue, Oct 09, 2018 at 07:20:40PM +0900, Amit Langote wrote: >> Sorry if I'm misunderstanding something, but why would we need a new >> clone? If we don't change pg_partition_tree() to only accept tables >> (regular/partitioned/foreign tables) as

Re: Refactor textToQualifiedNameList()

2018-10-09 Thread Michael Paquier
On Tue, Oct 09, 2018 at 09:54:12AM -0300, Alvaro Herrera wrote: > The committer of such a change will get a lot of flak for changing the > #include requirements for code that calls that function, though. So the patch has been switched to rejected... -- Michael signature.asc Description: PGP

Re: out-of-order XID insertion in KnownAssignedXids

2018-10-09 Thread Michael Paquier
On Tue, Oct 09, 2018 at 05:26:49PM +0300, Konstantin Knizhnik wrote: > But GetRunningTransactionData may be used in some other cases... For > example I have used it in my snapfs Postgres extensions (fast > file-level snapshots) to check if there are no more active > transactions in the system. In

Re: TAP tests for pg_verify_checksums

2018-10-09 Thread Michael Paquier
On Tue, Oct 09, 2018 at 05:14:50PM +0200, Michael Banck wrote: > Am Dienstag, den 09.10.2018, 16:54 +0200 schrieb Peter Eisentraut: >> On 06/10/2018 13:46, Michael Paquier wrote: > >>> +# Time to create a corruption > > That looks a bit weird, maybe "some corruption"? Or maybe it's just me > not

RE: IDE setup and development features?

2018-10-09 Thread Tsunakawa, Takayuki
From: Mori Bellamy [mailto:m...@invoked.net] > I'd like a few features when developing postgres -- (1) jump to definition > of symbol (2) find references to symbol and (3) semantic autocompletion. For 1), you can generate tags like: [for vi] $ src/tools/make_ctags [for Emacs] $

Re: [HACKERS] removing abstime, reltime, tinterval.c, spi/timetravel

2018-10-09 Thread Tom Lane
Andres Freund writes: > On 2018-10-09 16:17:44 -0700, Mark Dilger wrote: >> I have no objection, but I'm curious, when retiring a datatype and >> associated functions, do the Oids that were assigned to them become >> available for new uses, or do you have to expire them to avoid breaking >>

Re: [HACKERS] removing abstime, reltime, tinterval.c, spi/timetravel

2018-10-09 Thread Andres Freund
Hi, On 2018-10-09 16:17:44 -0700, Mark Dilger wrote: > > On Oct 9, 2018, at 12:22 PM, Andres Freund wrote: > > As discussed below (at [1]), I think we should remove $subject. I plan > > to do so, unless somebody protests soon-ish. I thought it'd be better > > to call attention to this in a new

Re: [HACKERS] removing abstime, reltime, tinterval.c, spi/timetravel

2018-10-09 Thread Mark Dilger
> On Oct 9, 2018, at 12:22 PM, Andres Freund wrote: > > In-Reply-To: <20180928223240.kgwc4czzzekrp...@alap3.anarazel.de> > > Hi, > > As discussed below (at [1]), I think we should remove $subject. I plan > to do so, unless somebody protests soon-ish. I thought it'd be better > to call

Re: Speeding up INSERTs and UPDATEs to partitioned tables

2018-10-09 Thread David Rowley
On 9 October 2018 at 15:49, Amit Langote wrote: > On 2018/10/05 21:55, David Rowley wrote: >> I'm not so sure we need to zero the partition_tuple_slots[] array at >> all since we always set a value there is there's a corresponding map >> stored. I considered pulling that out, but in the end, I

Re: IDE setup and development features?

2018-10-09 Thread David Fetter
On Tue, Oct 09, 2018 at 02:39:42PM -0700, Mori Bellamy wrote: > Hi all, > > I'd like a few features when developing postgres -- (1) jump to definition > of symbol (2) find references to symbol and (3) semantic autocompletion. > > Was wondering if anyone has had luck getting these three set up

Re: Make Windows print float exponents like everybody else?

2018-10-09 Thread Andres Freund
Hi, On 2018-10-09 18:00:54 -0400, Tom Lane wrote: > I can't believe I got no comments about this, so reposting it under > a more attention-getting title ... > > In https://www.postgresql.org/message-id/29037.1539021...@sss.pgh.pa.us > I wrote: > > > Also, we have quite a few variant

Make Windows print float exponents like everybody else?

2018-10-09 Thread Tom Lane
I can't believe I got no comments about this, so reposting it under a more attention-getting title ... In https://www.postgresql.org/message-id/29037.1539021...@sss.pgh.pa.us I wrote: > Also, we have quite a few variant expected-files that exist only to cater > for Windows' habit of printing

Re: IDE setup and development features?

2018-10-09 Thread Eren Başak
Hi Mori, There was a talk about that last year: https://speakerdeck.com/citusdata/hacking-postgresql-with-eclipse-pgconf-eu-2017-metin-doslu On Tue, Oct 9, 2018 at 2:39 PM Mori Bellamy wrote: > Hi all, > > I'd like a few features when developing postgres -- (1) jump to definition > of symbol

IDE setup and development features?

2018-10-09 Thread Mori Bellamy
Hi all, I'd like a few features when developing postgres -- (1) jump to definition of symbol (2) find references to symbol and (3) semantic autocompletion. Was wondering if anyone has had luck getting these three set up for any IDE or editor configuration? Personally, I can confirm vim + ctags

Re: [HACKERS] removing abstime, reltime, tinterval.c, spi/timetravel

2018-10-09 Thread Tom Lane
Andres Freund writes: > On 2018-10-09 17:27:17 -0400, Tom Lane wrote: >> I complained about this already on the other thread, I think, but: >> I do not think we should remove timeofday(). It's unrelated to these >> datatypes and it offers functionality that isn't quite duplicated >> elsewhere.

Re: [HACKERS] removing abstime, reltime, tinterval.c, spi/timetravel

2018-10-09 Thread Andres Freund
Hi, On 2018-10-09 17:27:17 -0400, Tom Lane wrote: > Andres Freund writes: > > As discussed below (at [1]), I think we should remove $subject. I plan > > to do so, unless somebody protests soon-ish. I thought it'd be better > > to call attention to this in a new thread, to make sure people had

Re: [HACKERS] removing abstime, reltime, tinterval.c, spi/timetravel

2018-10-09 Thread Tom Lane
Andres Freund writes: > As discussed below (at [1]), I think we should remove $subject. I plan > to do so, unless somebody protests soon-ish. I thought it'd be better > to call attention to this in a new thread, to make sure people had a > chance to object. I complained about this already on

Re: [HACKERS] kqueue

2018-10-09 Thread Thomas Munro
On Tue, Oct 2, 2018 at 6:28 AM Andres Freund wrote: > On 2018-10-01 19:25:45 +0200, Matteo Beccati wrote: > > On 01/10/2018 01:09, Thomas Munro wrote: > > > I don't know why the existence of the kqueue should make recvfrom() > > > slower on the pgbench side. That's probably something to look

Re: [HACKERS] removing abstime, reltime, tinterval.c, spi/timetravel

2018-10-09 Thread David Fetter
On Tue, Oct 09, 2018 at 01:43:48PM -0700, Andres Freund wrote: > > > On October 9, 2018 1:40:34 PM PDT, David Fetter > wrote: > >On Tue, Oct 09, 2018 at 12:31:19PM -0700, Andres Freund wrote: > >> Hi, > >> > >> On 2018-10-09 21:26:31 +0200, David Fetter wrote: > >> > On Tue, Oct 09, 2018 at

Re: pread() and pwrite()

2018-10-09 Thread Thomas Munro
On Tue, Oct 9, 2018 at 5:08 PM Tom Lane wrote: > I wrote: > > Thomas Munro writes: > >> On Tue, Oct 9, 2018 at 2:55 PM Tom Lane wrote: > >>> Yeah, I've been burnt by that too recently. It occurs to me we could make > >>> that at least a little less painful if we formatted the macro with one >

Re: [HACKERS] removing abstime, reltime, tinterval.c, spi/timetravel

2018-10-09 Thread Andres Freund
On October 9, 2018 1:40:34 PM PDT, David Fetter wrote: >On Tue, Oct 09, 2018 at 12:31:19PM -0700, Andres Freund wrote: >> Hi, >> >> On 2018-10-09 21:26:31 +0200, David Fetter wrote: >> > On Tue, Oct 09, 2018 at 12:22:37PM -0700, Andres Freund wrote: >> > > In-Reply-To:

Re: [HACKERS] removing abstime, reltime, tinterval.c, spi/timetravel

2018-10-09 Thread David Fetter
On Tue, Oct 09, 2018 at 12:31:19PM -0700, Andres Freund wrote: > Hi, > > On 2018-10-09 21:26:31 +0200, David Fetter wrote: > > On Tue, Oct 09, 2018 at 12:22:37PM -0700, Andres Freund wrote: > > > In-Reply-To: <20180928223240.kgwc4czzzekrp...@alap3.anarazel.de> > > > As discussed below (at [1]), I

Re: Support custom socket directory in pg_upgrade

2018-10-09 Thread Daniel Gustafsson
> On 9 Oct 2018, at 16:22, Tom Lane wrote: > > Daniel Gustafsson writes: >> Having hit the maximum socketdir length error a number of times in >> pg_upgrade, >> especially when running tests in a deep directory hierarchy, I figured it was >> time to see if anyone else has had the same problem?

Re: Some incorrect comments and out-dated README from run-time pruning

2018-10-09 Thread David Rowley
On 10 October 2018 at 02:38, Peter Eisentraut wrote: > - * subplan_map[] and subpart_map[] are indexed by partition index (where > - * zero is the topmost partition, and non-leaf partitions must come before > - * their children). For a leaf partition p, subplan_map[p] contains the > + *

Re: [HACKERS] Why does logical replication launcher exit with exit code 1?

2018-10-09 Thread Thomas Munro
On Fri, Oct 5, 2018 at 12:36 PM Thomas Munro wrote: > * We really should get rid of that "exited with exit code 1". Robert and I just discussed this subproblem (the original complaint of this thread) off-list. Our questions are: does anyone actually want that message from the postmaster in the

Re: chained transactions

2018-10-09 Thread Peter Eisentraut
On 05/04/2018 10:35, Heikki Linnakangas wrote: > On 15/03/18 18:39, Alvaro Herrera wrote: >>> From 517bc6d9fefdee9135857d9562f644f2984ace32 Mon Sep 17 00:00:00 2001 >>> From: Peter Eisentraut >>> Date: Sun, 18 Feb 2018 09:33:53 -0500 >>> Subject: [PATCH v1 6/8] Turn transaction_isolation into GUC

Re: [HACKERS] removing abstime, reltime, tinterval.c, spi/timetravel

2018-10-09 Thread Andres Freund
Hi, On 2018-10-09 21:26:31 +0200, David Fetter wrote: > On Tue, Oct 09, 2018 at 12:22:37PM -0700, Andres Freund wrote: > > In-Reply-To: <20180928223240.kgwc4czzzekrp...@alap3.anarazel.de> > > As discussed below (at [1]), I think we should remove $subject. I plan > > to do so, unless somebody

Re: [HACKERS] removing abstime, reltime, tinterval.c, spi/timetravel

2018-10-09 Thread David Fetter
On Tue, Oct 09, 2018 at 12:22:37PM -0700, Andres Freund wrote: > In-Reply-To: <20180928223240.kgwc4czzzekrp...@alap3.anarazel.de> > > Hi, > > As discussed below (at [1]), I think we should remove $subject. I plan > to do so, unless somebody protests soon-ish. I thought it'd be better > to call

[HACKERS] removing abstime, reltime, tinterval.c, spi/timetravel

2018-10-09 Thread Andres Freund
In-Reply-To: <20180928223240.kgwc4czzzekrp...@alap3.anarazel.de> Hi, As discussed below (at [1]), I think we should remove $subject. I plan to do so, unless somebody protests soon-ish. I thought it'd be better to call attention to this in a new thread, to make sure people had a chance to

Re: pread() and pwrite()

2018-10-09 Thread Andrew Dunstan
On 10/09/2018 02:37 PM, Andres Freund wrote: On 2018-10-09 14:32:29 -0400, Andrew Dunstan wrote: On 10/08/2018 09:55 PM, Tom Lane wrote: Thomas Munro writes: Rebased again. Patches that touch AC_CHECK_FUNCS are fun like that! Yeah, I've been burnt by that too recently. It occurs to me

Re: pread() and pwrite()

2018-10-09 Thread Andres Freund
On 2018-10-09 14:32:29 -0400, Andrew Dunstan wrote: > > > On 10/08/2018 09:55 PM, Tom Lane wrote: > > Thomas Munro writes: > > > Rebased again. Patches that touch AC_CHECK_FUNCS are fun like that! > > Yeah, I've been burnt by that too recently. It occurs to me we could make > > that at least

Re: executor relation handling

2018-10-09 Thread Tom Lane
Robert Haas writes: > On Sat, Oct 6, 2018 at 2:59 PM Tom Lane wrote: >> The reasons why we need locks on tables not physically accessed by the >> query are (a) to ensure that we've blocked, or received sinval messages >> for, any DDL related to views or partition parent tables, in case that >>

Re: pread() and pwrite()

2018-10-09 Thread Andrew Dunstan
On 10/08/2018 09:55 PM, Tom Lane wrote: Thomas Munro writes: Rebased again. Patches that touch AC_CHECK_FUNCS are fun like that! Yeah, I've been burnt by that too recently. It occurs to me we could make that at least a little less painful if we formatted the macro with one line per

Fwd: background worker shudown (was Re: [HACKERS] Why does logical replication launcher exit with exit code 1?)

2018-10-09 Thread Robert Haas
On Thu, Oct 4, 2018 at 7:37 PM Thomas Munro wrote: > I still think the current situation is non-ideal. I don't have a > strong view on whether some or all system-wide processes should say > hello and goodbye explicitly in the log, but I do think we need a way > to make that not look like an

Re: executor relation handling

2018-10-09 Thread Robert Haas
On Sat, Oct 6, 2018 at 2:59 PM Tom Lane wrote: > The reasons why we need locks on tables not physically accessed by the > query are (a) to ensure that we've blocked, or received sinval messages > for, any DDL related to views or partition parent tables, in case that > would invalidate the plan;

Re: Index Skip Scan

2018-10-09 Thread Pavel Stehule
út 9. 10. 2018 v 16:13 odesílatel Pavel Stehule napsal: > > > út 9. 10. 2018 v 15:59 odesílatel Dmitry Dolgov <9erthali...@gmail.com> > napsal: > >> > On Tue, 9 Oct 2018 at 15:43, Pavel Stehule >> wrote: >> > >> > Hi >> > >> > I tested last patch and I have some notes: >> > >> > 1. >> > >> >

Re: Proposal for Signal Detection Refactoring

2018-10-09 Thread Andres Freund
On October 9, 2018 6:58:18 AM PDT, Peter Eisentraut wrote: >On 25/09/2018 02:23, Andres Freund wrote: >>> My point was just to reduce the number of variables used and ease >>> debugger lookups with what is on the stack. >> I'm not sure a bitflag really gives you that - before gdb gives you

Re: TupleTableSlot abstraction

2018-10-09 Thread Amit Khandekar
On Wed, 26 Sep 2018 at 05:35, Andres Freund wrote: > > + > > +/* > > + * This is a function used by all getattr() callbacks which deal with a > > heap > > + * tuple or some tuple format which can be represented as a heap tuple > > e.g. a > > + * minimal tuple. > > + * > > + * heap_getattr

Re: executor relation handling

2018-10-09 Thread Amit Langote
On Tue, Oct 9, 2018 at 11:07 PM Tom Lane wrote: > > Amit Langote writes: > > On 2018/10/08 3:55, Tom Lane wrote: > >> I didn't like the idea of unifying ModifyTable.nominalRelation with > >> the partition root info. Those fields serve different masters --- > >> nominalRelation, at least in its

Re: TAP tests for pg_verify_checksums

2018-10-09 Thread Michael Banck
Hi, Am Dienstag, den 09.10.2018, 16:54 +0200 schrieb Peter Eisentraut: > On 06/10/2018 13:46, Michael Paquier wrote: > > What do you think about the updated version attached? > > +# Time to create a corruption That looks a bit weird, maybe "some corupption"? Or maybe it's just me not being a

Re: TAP tests for pg_verify_checksums

2018-10-09 Thread Peter Eisentraut
On 06/10/2018 13:46, Michael Paquier wrote: > On Fri, Oct 05, 2018 at 01:38:05PM +0200, Michael Banck wrote: >> It's too late for v11 though at this point I guess? > > Unfortunately yes. > >> I think it would be easy to also test the -r command-line option, as we >> already create a table. > >

Re: out-of-order XID insertion in KnownAssignedXids

2018-10-09 Thread Konstantin Knizhnik
On 09.10.2018 10:52, Michael Paquier wrote: On Tue, Oct 09, 2018 at 02:59:00PM +0900, Michael Paquier wrote: +1. I am looking at how to make that possible. And so... Going through a bit of investigation the problem is that each 2PC transaction preparing finishes by putting the procarray in

Re: Support custom socket directory in pg_upgrade

2018-10-09 Thread Tom Lane
Daniel Gustafsson writes: > Having hit the maximum socketdir length error a number of times in pg_upgrade, > especially when running tests in a deep directory hierarchy, I figured it was > time to see if anyone else has had the same problem? The attached patch is > what I run with locally to

Re: Add overflow test in function numeric_exp.

2018-10-09 Thread Tom Lane
Yang Xiao writes: > The attachment is the proposal patch for function numeric_exp in > src/backend/utils/adt/numeric.c. Why do we need this? numeric_exp() already detects result overflow. regression=# select numeric_exp(1); ERROR: value overflows numeric format

Re: [patch]overallocate memory for curly braces in array_out

2018-10-09 Thread Keiichi Hirobe
Sorry, I did not notice that you had already pushed it. Thank you for quick action. Cheers, Keiichi Hirobe 2018年9月28日(金) 9:23 Tom Lane : > Keiichi Hirobe writes: > > I am not sure whether to fix another bug, but I fixed and I attached a > new > > patch, > > please check it. > > I think this

Re: Index Skip Scan

2018-10-09 Thread Pavel Stehule
út 9. 10. 2018 v 15:59 odesílatel Dmitry Dolgov <9erthali...@gmail.com> napsal: > > On Tue, 9 Oct 2018 at 15:43, Pavel Stehule > wrote: > > > > Hi > > > > I tested last patch and I have some notes: > > > > 1. > > > > postgres=# explain select distinct a1 from foo; > > >

Re: executor relation handling

2018-10-09 Thread Tom Lane
Amit Langote writes: > On 2018/10/08 3:55, Tom Lane wrote: >> I didn't like the idea of unifying ModifyTable.nominalRelation with >> the partition root info. Those fields serve different masters --- >> nominalRelation, at least in its original intent, is only meant for >> use of EXPLAIN and

Re: Race condition in create table

2018-10-09 Thread Tom Lane
Konstantin Knizhnik writes: > I wonder if it is considered to be expected behavior that concurrent > execution of "create table if not exists" may return errors: No, there's not a guarantee that IF NOT EXISTS will work in such scenarios. As with everything else about that feature, it's a

Re: Proposal for Signal Detection Refactoring

2018-10-09 Thread Peter Eisentraut
On 01/10/2018 14:00, Chris Travers wrote: > > > On Wed, Sep 26, 2018 at 9:54 AM Chris Travers > wrote: > > > > On Tue, Sep 25, 2018 at 3:23 PM Tom Lane > wrote: > > Chris Travers

Race condition in create table

2018-10-09 Thread Konstantin Knizhnik
I wonder if it is considered to be expected behavior that concurrent execution of "create table if not exists" may return errors: knizhnik@knizhnik:~/dtm-data$ pgbench -n -c 8 -t 20 -f create_table.sql postgres client 2 aborted in command 0 (SQL) of script 0; ERROR:  duplicate key value

Re: Index Skip Scan

2018-10-09 Thread Dmitry Dolgov
> On Tue, 9 Oct 2018 at 15:43, Pavel Stehule wrote: > > Hi > > I tested last patch and I have some notes: > > 1. > > postgres=# explain select distinct a1 from foo; > +---+ > |

Re: Index Skip Scan

2018-10-09 Thread Jesper Pedersen
Hi Pavel, On 10/9/18 9:42 AM, Pavel Stehule wrote: I tested last patch and I have some notes: 1. postgres=# explain select distinct a1 from foo; +---+ |QUERY

Re: Proposal for Signal Detection Refactoring

2018-10-09 Thread Peter Eisentraut
On 25/09/2018 02:23, Andres Freund wrote: >> My point was just to reduce the number of variables used and ease >> debugger lookups with what is on the stack. > I'm not sure a bitflag really gives you that - before gdb gives you the > plain value, afterwards you need to know the enum values and do

Re: Index Skip Scan

2018-10-09 Thread Pavel Stehule
Hi I tested last patch and I have some notes: 1. postgres=# explain select distinct a1 from foo; +---+ |QUERY PLAN |

Re: Function for listing archive_status directory

2018-10-09 Thread Michael Paquier
On Tue, Oct 09, 2018 at 10:12:17AM +0200, 'Christoph Moench-Tegeder' wrote: > Attached is the updated patch. I made sure the function's OID hadn't been > taken otherwise, and it compiles and works in a quick check. Committed, after some slight adjustments. Files in pg_wal/archive_status/ have

Re: Some incorrect comments and out-dated README from run-time pruning

2018-10-09 Thread Peter Eisentraut
On 27/09/2018 23:20, David Rowley wrote: > I've noticed that the comments above the PartitionedRelPruneInfo > struct incorrectly document how subplan_map and subpart_map are > indexed. This seems to have snuck in on 4e232364033. - * subplan_map[] and subpart_map[] are indexed by partition index

Support custom socket directory in pg_upgrade

2018-10-09 Thread Daniel Gustafsson
Having hit the maximum socketdir length error a number of times in pg_upgrade, especially when running tests in a deep directory hierarchy, I figured it was time to see if anyone else has had the same problem? The attached patch is what I run with locally to avoid the issue, it adds a

Re: Refactor textToQualifiedNameList()

2018-10-09 Thread Alvaro Herrera
On 2018-Oct-09, Michael Paquier wrote: > On Tue, Oct 09, 2018 at 10:47:48AM +0200, Pavel Stehule wrote: > > The difference on 10M calls is about 300ms - it is about 6%. > > This number gives a good argument for rejecting this patch. I am not > usually against code beautification, but that's a

RE: NOTIFY and pg_notify performance when deduplicating notifications

2018-10-09 Thread julien
> Indeed, I have the same and am very interested in this. > > > I hope this patch can be reviewed and included in PostgreSQL. > > I added this to the next Commitfest and added myself as a reviewer. > Will try to a review beginning of next week. > https://commitfest.postgresql.org/20/1820/ Thank

Re: partition tree inspection functions

2018-10-09 Thread Michael Paquier
On Tue, Oct 09, 2018 at 08:17:20PM +0900, Michael Paquier wrote: > isleaf is of course wrong if the input is a partitioned index, so more > regression tests to cover those cases would be nice. Also, the call to find_all_inheritors needs AccessShareLock... NoLock is not secure. -- Michael

Re: Refactor textToQualifiedNameList()

2018-10-09 Thread Pavel Stehule
út 9. 10. 2018 v 13:20 odesílatel Michael Paquier napsal: > On Tue, Oct 09, 2018 at 10:47:48AM +0200, Pavel Stehule wrote: > > The difference on 10M calls is about 300ms - it is about 6%. > > This number gives a good argument for rejecting this patch. I am not > usually against code

Re: Refactor textToQualifiedNameList()

2018-10-09 Thread Michael Paquier
On Tue, Oct 09, 2018 at 10:47:48AM +0200, Pavel Stehule wrote: > The difference on 10M calls is about 300ms - it is about 6%. This number gives a good argument for rejecting this patch. I am not usually against code beautification, but that's a high price to pay for just some refactoring. On

Re: partition tree inspection functions

2018-10-09 Thread Michael Paquier
On Tue, Oct 09, 2018 at 07:20:40PM +0900, Amit Langote wrote: > Sorry if I'm misunderstanding something, but why would we need a new > clone? If we don't change pg_partition_tree() to only accept tables > (regular/partitioned/foreign tables) as input, then the same code can work > for indexes as

Re: partition tree inspection functions

2018-10-09 Thread Amit Langote
On 2018/10/09 19:05, Michael Paquier wrote: > On Tue, Oct 09, 2018 at 06:41:59PM +0900, Amit Langote wrote: >> Partitioned indexes, just like partitioned tables, don't have their own >> storage, so pg_relation_size() cannot be used to obtain their size. We >> decided that the correct way to get

Re: pgbench exit code

2018-10-09 Thread Peter Eisentraut
On 10/08/2018 01:41, Fabien COELHO wrote: > Your approach of not changing the output too much but changing the exit > status and adding a warning may get through more easily. > > Note that there is some logic in distinguishing between different type of > errors (before the bench start vs the

Re: partition tree inspection functions

2018-10-09 Thread Michael Paquier
On Tue, Oct 09, 2018 at 06:41:59PM +0900, Amit Langote wrote: > Partitioned indexes, just like partitioned tables, don't have their own > storage, so pg_relation_size() cannot be used to obtain their size. We > decided that the correct way to get the partitioned table's size is *not* > to modify

Re: partition tree inspection functions

2018-10-09 Thread Amit Langote
On 2018/10/09 18:10, Michael Paquier wrote: > On Tue, Oct 09, 2018 at 05:11:59PM +0900, Amit Langote wrote: >> Hmm, how would one find the size of a partitioned index tree if we don't >> allow indexes to be passed? > > pg_total_relation_size() and pg_indexes_size() are designed for that >

[ECPG] fix functions in dt_common to correctly detect integer overflow

2018-10-09 Thread Yang Xiao
Hi, The attachment is the proposal patch for dt_common.c. replace strtol to strtoint, as strtol() will return 64-bit output in that case, while type of var, hr, tm_min  is int. Young From fa744e6b2b2601a91080a016f480d443cd1dbf2d Mon Sep 17 00:00:00 2001 From: Young_X Date: Tue, 9 Oct 2018

Add overflow test in function numeric_exp.

2018-10-09 Thread Yang Xiao
Hi, The attachment is the proposal patch for function numeric_exp in src/backend/utils/adt/numeric.c. Young From 0456192bbe03428247b9f55b261b24b4b890c680 Mon Sep 17 00:00:00 2001 From: Young_X Date: Tue, 9 Oct 2018 10:59:22 +0800 Subject: [PATCH] Add overflow test in function numeric_exp.

Re: pgsql: Improve autovacuum logging for aggressive and anti-wraparound ru

2018-10-09 Thread Kyotaro HORIGUCHI
At Fri, 5 Oct 2018 15:35:04 +0900, Michael Paquier wrote in <20181005063504.gb14...@paquier.xyz> > On Fri, Oct 05, 2018 at 12:16:03PM +0900, Michael Paquier wrote: > > So, I have come back to this stuff, and finished with the attached > > instead, so as the assertion is in a single place. I

Re: partition tree inspection functions

2018-10-09 Thread Michael Paquier
On Tue, Oct 09, 2018 at 05:11:59PM +0900, Amit Langote wrote: > Hmm, how would one find the size of a partitioned index tree if we don't > allow indexes to be passed? pg_total_relation_size() and pg_indexes_size() are designed for that purpose. Anyway, the elements of a partition tree are things

Re: partition tree inspection functions

2018-10-09 Thread Amit Langote
On 2018/10/06 15:26, Michael Paquier wrote: > On Fri, Oct 05, 2018 at 08:22:49AM -0400, Jesper Pedersen wrote: >> Looks good. > > Actually, after sleeping on it, there could be potentially two problems: > 1) We don't check the relkind of the relation. For example it is > possible to get a tree

Re: Function for listing archive_status directory

2018-10-09 Thread 'Christoph Moench-Tegeder'
## Michael Paquier (mich...@paquier.xyz): > Thanks Iwata-san. I was just trying to apply the patch but it failed so > the new status is fine. On top of taking care of the rebase, please > make sure of the following: OK, that was an easy one. > - Calling pg_ls_dir_files() with missing_ok set

Re: executor relation handling

2018-10-09 Thread Amit Langote
On 2018/10/08 8:18, Tom Lane wrote: > I wrote: >> Still need to think a bit more about whether we want 0005 in >> anything like its current form. > > So I poked at that for a bit, and soon realized that the *main* problem > there is that ExecFindRowMark() eats O(N^2) time due to repeated searches

Re: out-of-order XID insertion in KnownAssignedXids

2018-10-09 Thread Michael Paquier
On Tue, Oct 09, 2018 at 02:59:00PM +0900, Michael Paquier wrote: > +1. I am looking at how to make that possible. And so... Going through a bit of investigation the problem is that each 2PC transaction preparing finishes by putting the procarray in a state where there are two entries referring

Re: executor relation handling

2018-10-09 Thread Amit Langote
On 2018/10/08 9:29, David Rowley wrote: > On 8 October 2018 at 13:13, Tom Lane wrote: >> The idea I had in mind was to allow hard pruning of any leaf that's >> been excluded *at plan time* based on partition constraints seen in >> its parent rel(s). That should be safe enough as long as we take

Re: executor relation handling

2018-10-09 Thread Amit Langote
On 2018/10/09 0:38, Tom Lane wrote: > I wrote: >> Keeping that comparison in mind, I'm inclined to think that 0001 >> is the best thing to do for now. The incremental win from 0002 >> is not big enough to justify the API break it creates, while your >> 0005 is not really attacking the problem the

Re: merge semi join cost calculation error

2018-10-09 Thread Pavel Stehule
po 8. 10. 2018 v 17:00 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > The user sent a plan: > > > QUERY PLAN > > Merge Semi Join (cost=82.97..580.24 rows=580 width=8) (actual > > time=0.503..9557.396 rows=721 loops=1) > > Merge Cond: (tips.users_id = follows.users_id_to) > > ->

Re: executor relation handling

2018-10-09 Thread Amit Langote
On 2018/10/08 3:55, Tom Lane wrote: > I didn't like the idea of unifying ModifyTable.nominalRelation with > the partition root info. Those fields serve different masters --- > nominalRelation, at least in its original intent, is only meant for > use of EXPLAIN and might have nothing to do with

Re: executor relation handling

2018-10-09 Thread Amit Langote
On 2018/10/07 3:59, Tom Lane wrote: > Amit Langote writes: >> On 2018/10/05 5:59, Tom Lane wrote: >>> So I'm inclined to just omit 0003. AFAICS this would only mean that >>> we couldn't drop the global PlanRowMarks list from PlannedStmt, which >>> does not bother me much. > >> To be honest, I

Re: pg_upgrade failed with ERROR: null relpartbound for relation 18159 error.

2018-10-09 Thread Amit Langote
On 2018/10/08 0:09, Michael Paquier wrote: > On Sun, Oct 07, 2018 at 11:13:19AM -0300, Alvaro Herrera wrote: >> Good point. I cannot do that today, but if you want to, please go >> ahead. > > Okay, done. Thank you both. Regards, Amit

Re: out-of-order XID insertion in KnownAssignedXids

2018-10-09 Thread Michael Paquier
On Mon, Oct 08, 2018 at 09:30:49AM -0700, Andres Freund wrote: > Sounds less terrible, but still pretty bad. I think we should fix the > underlying data inconsistency, not paper over it a couple hundred meters > away. +1. I am looking at how to make that possible. -- Michael signature.asc