Re: [HACKERS] [BUGS] Bug in Physical Replication Slots (at least 9.5)?

2017-09-03 Thread Kyotaro HORIGUCHI
Hello, Thank you for reviewing this. At Mon, 28 Aug 2017 20:14:54 +0900, Michael Paquier wrote in > On Mon, Aug 28, 2017 at 8:02 PM, Kyotaro HORIGUCHI > wrote: > > The first patch (0001-) fixes this problem, preventing the > > problematic state of WAL segments by retarding restart LSN of a >

Re: [HACKERS] Minor code improvement to postgresGetForeignPlan

2017-09-03 Thread Tatsuro Yamada
Hi Fujita-san, > The patch looks good to me, so I'll mark this as Ready for Committer. Thanks for reviewing my patch. > (I'm not sure we should do the same thing to the function declaration in > other places such as fdwapi.h and the documentation for consistency, but if > so, I'd vote for lea

Re: [HACKERS] CLUSTER command progress monitor

2017-09-03 Thread Michael Paquier
On Thu, Aug 31, 2017 at 11:12 AM, Tatsuro Yamada wrote: > Then I have questions. > > * Should we have separate views for them? Or should both be covered by the > same view with some indication of which command (CLUSTER or VACUUM FULL) > is actually running? Using the same view for both

Re: [HACKERS] POC: Sharing record typmods between backends

2017-09-03 Thread Thomas Munro
Thanks for the review and commits so far. Here's a rebased, debugged and pgindented version of the remaining patches. I ran pgindent with --list-of-typedefs="SharedRecordTableKey,SharedRecordTableEntry,SharedTypmodTableEntry,SharedRecordTypmodRegistry,Session" to fix some weirdness around these n

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

2017-09-03 Thread Michael Paquier
On Fri, Sep 1, 2017 at 3:53 AM, Jacob Champion wrote: > The patch is really two pieces: add the assertion, and fix the callers > that would trip it. The latter part is still in progress, because I'm > running into some places where I'm not sure what the correct way > forward is. I looked at your

Re: [HACKERS] CLUSTER command progress monitor

2017-09-03 Thread Tatsuro Yamada
Hi Sawada-san, Thanks for taking your time. I'll be more careful. Regards, Tatsuro Yamada On 2017/09/04 11:51, Masahiko Sawada wrote: On Mon, Sep 4, 2017 at 11:37 AM, Tatsuro Yamada wrote: Hi Sawada-san, Thomas, Thanks for sharing the reggression.diff. I realized Thomas's comment is right.

Re: [HACKERS] Parallel worker error

2017-09-03 Thread Pavan Deolasee
On Wed, Aug 30, 2017 at 8:49 PM, Robert Haas wrote: > > > But since that's an established design fl^H^Hprinciple, maybe that > means we should go with the approach of teaching SerializeGUCState() > to ignore role altogether and instead have ParallelWorkerMain call > SetCurrentRoleId using informa

Re: [HACKERS] Proposal: Improve bitmap costing for lossy pages

2017-09-03 Thread Dilip Kumar
On Thu, Aug 31, 2017 at 11:27 PM, Robert Haas wrote: I have repeated one of the tests after fixing the problems pointed by you but this time results are not that impressive. Seems like below check was the problem in the previous patch if (tbm->nentries > tbm->maxentries / 2) tbm->max

Re: [HACKERS] pg_basebackup throttling doesn't throttle as promised

2017-09-03 Thread Michael Paquier
On Sat, Sep 2, 2017 at 6:42 AM, Jeff Janes wrote: > I'm attaching a patch for each option. Each one independently solves the > problem. But I think we should do both. There is no point in issuing > unnecessary kill system calls, and there may also be more spurious wake-ups > than just these one

Re: [HACKERS] dropping partitioned tables without CASCADE

2017-09-03 Thread Amit Langote
Hi Ashutosh, On 2017/09/04 13:51, Ashutosh Bapat wrote: > Hi, > Thomas's application to track patches told me that this patch needs > rebase. It also required some changes to the code. Here's the updated > version. I have squashed those two patches together. Thanks for the rebased patch. Would i

Re: [HACKERS] asynchronous execution

2017-09-03 Thread Kyotaro HORIGUCHI
At Thu, 31 Aug 2017 21:52:36 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20170831.215236.135328985.horiguchi.kyot...@lab.ntt.co.jp> > At Thu, 03 Aug 2017 09:30:57 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI > wrote in > <20170803.093057.261590619.horiguchi.kyot...@lab.ntt.co.j

Re: [HACKERS] dropping partitioned tables without CASCADE

2017-09-03 Thread Ashutosh Bapat
Hi, Thomas's application to track patches told me that this patch needs rebase. It also required some changes to the code. Here's the updated version. I have squashed those two patches together. On Tue, Mar 14, 2017 at 6:35 PM, Ashutosh Bapat wrote: > Added this to 2017/7 commitfest to keep a tra

Re: [HACKERS] [Proposal] Allow users to specify multiple tables in VACUUM commands

2017-09-03 Thread Michael Paquier
On Sat, Sep 2, 2017 at 3:00 AM, Bossart, Nathan wrote: > Don't we have a similar problem with makeVacuumRelation() and list_make1()? Yeah, indeed. I forgot about this portion. > I went ahead and moved the RangeVar, VacuumRelation, and List into local > variables for now, but I agree that this co

Re: [HACKERS] Partition-wise join for join between (declaratively) partitioned tables

2017-09-03 Thread Amit Langote
On 2017/09/04 12:38, Etsuro Fujita wrote: > On 2017/09/02 4:10, Ashutosh Bapat wrote: >> This rebase mainly changes patch 0001, which translates partition >> hierarchy into inheritance hierarchy creating AppendRelInfos and >> RelOptInfos for partitioned partitions. Because of that, it's not >> nece

Re: [HACKERS] [bug fix] Savepoint-related statements terminates connection

2017-09-03 Thread Michael Paquier
On Mon, Sep 4, 2017 at 7:20 AM, Tom Lane wrote: > I wrote: > On further consideration, I think the control logic I added in > exec_simple_query() is a shade bogus. I set it up to only force > an implicit transaction block when there are at least two statements > remaining to execute. However, th

Re: [HACKERS] Partition-wise join for join between (declaratively) partitioned tables

2017-09-03 Thread Etsuro Fujita
On 2017/09/02 4:10, Ashutosh Bapat wrote: This rebase mainly changes patch 0001, which translates partition hierarchy into inheritance hierarchy creating AppendRelInfos and RelOptInfos for partitioned partitions. Because of that, it's not necessary to record the partitioned partitions in a Partit

Re: [HACKERS] CLUSTER command progress monitor

2017-09-03 Thread Masahiko Sawada
On Mon, Sep 4, 2017 at 11:37 AM, Tatsuro Yamada wrote: > Hi Sawada-san, Thomas, > > Thanks for sharing the reggression.diff. > I realized Thomas's comment is right. > > Attached patch is fixed version. > Could you try it? > Yeah, in my environment the regression test passed. Thanks. Regards, --

Re: [HACKERS] Secondary index access optimizations

2017-09-03 Thread Amit Langote
On 2017/09/02 12:44, Thomas Munro wrote: > On Wed, Aug 16, 2017 at 9:23 PM, Konstantin Knizhnik > wrote: >> postgres=# explain select * from bt where k between 1 and 2 and v = 100; >> QUERY PLAN >> --

Re: [HACKERS] CLUSTER command progress monitor

2017-09-03 Thread Tatsuro Yamada
Hi Sawada-san, Thomas, Thanks for sharing the reggression.diff. I realized Thomas's comment is right. Attached patch is fixed version. Could you try it? Regards, Tatsuro Yamada NTT Open Source Software Center On 2017/09/01 17:59, Masahiko Sawada wrote: On Fri, Sep 1, 2017 at 3:38 PM, Tatsuro

Re: [HACKERS] Fix warnings and typo in dshash

2017-09-03 Thread Amit Kapila
On Sun, Sep 3, 2017 at 2:56 PM, Thomas Munro wrote: > On Sun, Sep 3, 2017 at 6:57 PM, Amit Kapila wrote: >> I am seeing below warnings (on Win7) in dshash.c >> >> 1> dshash.c >> 1>src/backend/lib/dshash.c(318): warning C4334: '<<' : result of >> 32-bit shift implicitly converted to 64 bits (was

Re: [HACKERS] UPDATE of partition key

2017-09-03 Thread Amit Kapila
On Sun, Sep 3, 2017 at 5:10 PM, Amit Khandekar wrote: > On 31 August 2017 at 14:15, Amit Khandekar wrote: >> Thanks Dilip. I am working on rebasing the patch. Particularly, the >> partition walker in my patch depended on the fact that all the tables >> get opened (and then closed) while creating

Re: [HACKERS] pgbench: Skipping the creating primary keys after initialization

2017-09-03 Thread Masahiko Sawada
On Fri, Sep 1, 2017 at 11:29 PM, Fabien COELHO wrote: > >>> I'm wondering whether this truncation should be yet another available >>> command? Hmmm... maybe not. >> >> >> Currently TRUNCATE pgbench_accounts command is executed within a >> transaction started immediately before it. If we move it ou

Re: [HACKERS] INSERT .. ON CONFLICT DO SELECT [FOR ..]

2017-09-03 Thread Peter Geoghegan
On Tue, Aug 15, 2017 at 12:17 AM, Marko Tiikkaja wrote: > On Tue, Aug 15, 2017 at 7:43 AM, Peter Geoghegan wrote: >> >> On Mon, Aug 14, 2017 at 6:23 PM, Marko Tiikkaja wrote: >> > Attached is a patch for $SUBJECT. It might still be a bit rough around >> > the >> > edges and probably light on do

Re: [HACKERS] path toward faster partition pruning

2017-09-03 Thread Amit Langote
Thanks for the comments. On 2017/09/02 2:52, Robert Haas wrote: > On Thu, Aug 31, 2017 at 2:02 AM, Amit Langote > wrote: >> Attached is now also the set of patches that implement the actual >> partition-pruning logic, viz. the last 3 patches (0004, 0005, and 0006) of >> the attached. > > It stri

Re: [HACKERS] expanding inheritance in partition bound order

2017-09-03 Thread Amit Langote
Hi Amit, On 2017/09/03 16:07, Amit Khandekar wrote: > On 31 August 2017 at 13:06, Amit Langote > wrote: >>> Mind you, that idea has some problems anyway in the face of default >>> partitions, null partitions, and list partitions which accept >>> non-contiguous values (e.g. one partition for 1, 3

Re: odd behavior/possible bug (Was: Re: [HACKERS] PG10 partitioning - odd behavior/possible bug)

2017-09-03 Thread Joe Conway
On 09/03/2017 03:34 PM, Tom Lane wrote: > Joe Conway writes: >> Notice that tsr is not empty at all on the first loop, but on the second >> loop it is empty every second time the trigger fires. > > I think the issue is that now() isn't changing within the transaction, > so when you construct "tst

Re: odd behavior/possible bug (Was: Re: [HACKERS] PG10 partitioning - odd behavior/possible bug)

2017-09-03 Thread Tom Lane
Joe Conway writes: > Notice that tsr is not empty at all on the first loop, but on the second > loop it is empty every second time the trigger fires. I think the issue is that now() isn't changing within the transaction, so when you construct "tstzrange(lower(OLD.tr), now(), '[)')" using an old r

odd behavior/possible bug (Was: Re: [HACKERS] PG10 partitioning - odd behavior/possible bug)

2017-09-03 Thread Joe Conway
On 09/03/2017 02:28 PM, Joe Conway wrote: > I was playing around with partitioning and found an oddity that is best > described with the following reasonably minimal test case: > Notice that in the first loop iteration tsr is calculated from OLD.tr > correctly. But in the second loop iteration i

Re: [HACKERS] [bug fix] Savepoint-related statements terminates connection

2017-09-03 Thread Tom Lane
I wrote: > ... PFA a patch > that invents a notion of an "implicit" transaction block. On further consideration, I think the control logic I added in exec_simple_query() is a shade bogus. I set it up to only force an implicit transaction block when there are at least two statements remaining to e

[HACKERS] PG10 partitioning - odd behavior/possible bug

2017-09-03 Thread Joe Conway
I was playing around with partitioning and found an oddity that is best described with the following reasonably minimal test case: 8<- CREATE TABLE timetravel ( id int8, f1 text not null, tr tstzrange not null default tstzrange(now(), 'infinity', '[]') ) PARTITION BY RANGE (upper(tr)

Re: [HACKERS] adding the commit to a patch's thread

2017-09-03 Thread Daniel Gustafsson
> On 03 Sep 2017, at 21:12, Magnus Hagander wrote: > > On Sun, Sep 3, 2017 at 8:55 PM, Daniel Gustafsson > wrote: > > That leaves us back at parsing/scraping -committers and adding the mailthread. > For this CF I can add the commits manually, since attaching a thread isn

Re: [HACKERS] Optional message to user when terminating/cancelling backend

2017-09-03 Thread Daniel Gustafsson
> On 02 Sep 2017, at 02:21, Thomas Munro wrote: > > On Fri, Jun 23, 2017 at 1:48 AM, Daniel Gustafsson wrote: >> Good point. I’ve attached a new version which issues a NOTICE on truncation >> and also addresses all other comments so far in this thread. Thanks a lot >> for >> the early patch r

Re: [HACKERS] [RFC] What would be difficult to make data models pluggable for making PostgreSQL a multi-model database?

2017-09-03 Thread MauMau
From: Henry M > This may be interesting... they implement cypher (unfortunately they had to fork in order to have cypher be a first class query language with SQL). > > https://github.com/bitnine-oss/agensgraph I'm sorry for my very late reply. Thanks for the information. AgensGraph is certainly

Re: [HACKERS] Function to move the position of a replication slot

2017-09-03 Thread Magnus Hagander
On Sun, Sep 3, 2017 at 12:20 AM, Robert Haas wrote: > On Fri, Sep 1, 2017 at 11:30 PM, Peter Eisentraut > wrote: > > On 8/31/17 08:19, Magnus Hagander wrote: > >> Rebased. Now named pg_advance_replication_slot. ERROR on logical slots. > >> Forward only. > >> > >> I think that, in the end, covere

Re: [HACKERS] adding the commit to a patch's thread

2017-09-03 Thread Magnus Hagander
On Sun, Sep 3, 2017 at 8:55 PM, Daniel Gustafsson wrote: > > On 03 Sep 2017, at 19:33, Magnus Hagander wrote: > > > > On Sun, Sep 3, 2017 at 12:00 AM, Daniel Gustafsson > wrote: > > > On 01 Sep 2017, at 15:40, Robert Haas robertmh...@gmail.com>> wrote: > > > > > > On Fr

Re: [HACKERS] adding the commit to a patch's thread

2017-09-03 Thread Daniel Gustafsson
> On 03 Sep 2017, at 19:33, Magnus Hagander wrote: > > On Sun, Sep 3, 2017 at 12:00 AM, Daniel Gustafsson > wrote: > > On 01 Sep 2017, at 15:40, Robert Haas > > wrote: > > > > On Fri, Sep 1, 2017 at 4:26 AM, Alvaro Herrera >

Re: [HACKERS] [PATCH] Move all am-related reloption code into src/backend/access/[am-name] and get rid of relopt_kind for custom AM

2017-09-03 Thread Alvaro Herrera
Nikolay Shaplov wrote: > В письме от 25 июня 2017 21:05:49 пользователь Nikolay Shaplov написал: > > I've just made sure that patch is still applyable to the current master. > > And I am still waiting for reviews :-) I see that this patch adds a few tests for reloptions, for instance in bloom.

Re: [HACKERS] JIT & function naming

2017-09-03 Thread Andres Freund
On 2017-09-03 10:11:37 -0400, Tom Lane wrote: > Andres Freund writes: > > Currently there's essentially a per EState counter and the generated > > functions get named deform$n and evalexpr$n. That allows for profiling > > of a single query, because different compiled expressions are > > disambigua

Re: [HACKERS] adding the commit to a patch's thread

2017-09-03 Thread Magnus Hagander
On Sun, Sep 3, 2017 at 12:00 AM, Daniel Gustafsson wrote: > > On 01 Sep 2017, at 15:40, Robert Haas wrote: > > > > On Fri, Sep 1, 2017 at 4:26 AM, Alvaro Herrera > wrote: > >> Erik Rijkers wrote: > >>> Would it be possible to change the commitfest a bit and make it > possible to > >>> add the c

Re: [HACKERS] Fix warnings and typo in dshash

2017-09-03 Thread Tom Lane
Thomas Munro writes: > Aside from these 3 warnings, it looks like the other 17 are all > "warning C4005: 'HAVE_LONG_LONG_INT_64': macro redefinition". Oh, I think that one might be my fault. I tweaked pg_config.h.win32 in 9d6b160d7 to use "#define HAVE_LONG_LONG_INT_64 1", for consistency with w

Re: [HACKERS] Fix warnings and typo in dshash

2017-09-03 Thread Tom Lane
Amit Kapila writes: > I am seeing below warnings (on Win7) in dshash.c > 1> dshash.c > 1>src/backend/lib/dshash.c(318): warning C4334: '<<' : result of > 32-bit shift implicitly converted to 64 bits (was 64-bit shift > intended?) > 1>src/backend/lib/dshash.c(679): warning C4334: '<<' : result of

Re: [HACKERS] JIT & function naming

2017-09-03 Thread Tom Lane
Andres Freund writes: > Currently there's essentially a per EState counter and the generated > functions get named deform$n and evalexpr$n. That allows for profiling > of a single query, because different compiled expressions are > disambiguated. It even allows to run the same query over and over,

Re: [HACKERS] Adding support for Default partition in partitioning

2017-09-03 Thread Jeevan Ladhe
On Sat, Sep 2, 2017 at 7:03 AM, Robert Haas wrote: > On Fri, Sep 1, 2017 at 3:19 PM, Robert Haas wrote: > > On Thu, Aug 31, 2017 at 8:53 AM, Jeevan Ladhe > > wrote: > >> 0001: > >> This patch refactors RelationBuildPartitionDesc(), basically this is > patch > >> 0001 of default range partition[

Re: [HACKERS] UPDATE of partition key

2017-09-03 Thread Amit Khandekar
On 31 August 2017 at 14:15, Amit Khandekar wrote: > Thanks Dilip. I am working on rebasing the patch. Particularly, the > partition walker in my patch depended on the fact that all the tables > get opened (and then closed) while creating the tuple routing info. > But in HEAD, now only the partitio

Re: [HACKERS] Fix warnings and typo in dshash

2017-09-03 Thread Thomas Munro
On Sun, Sep 3, 2017 at 6:57 PM, Amit Kapila wrote: > I am seeing below warnings (on Win7) in dshash.c > > 1> dshash.c > 1>src/backend/lib/dshash.c(318): warning C4334: '<<' : result of > 32-bit shift implicitly converted to 64 bits (was 64-bit shift > intended?) > 1>src/backend/lib/dshash.c(679):

Re: [HACKERS] expanding inheritance in partition bound order

2017-09-03 Thread Amit Khandekar
On 31 August 2017 at 13:06, Amit Langote wrote: >> Mind you, that idea has some problems anyway in the face of default >> partitions, null partitions, and list partitions which accept >> non-contiguous values (e.g. one partition for 1, 3, 5; another for 2, >> 4, 6). We might need to mark the Part

Re: [HACKERS] JIT & function naming

2017-09-03 Thread Konstantin Knizhnik
On 09/03/2017 02:59 AM, Andres Freund wrote: Hi, On 2017-08-31 23:41:31 -0700, Andres Freund wrote: I previously had an early prototype of JITing [1] expression evaluation and tuple deforming. I've since then worked a lot on this. Here's an initial, not really pretty but functional, submissio