Re: [HACKERS] log_destination=file

2017-09-07 Thread Dmitry Dolgov
> On 8 September 2017 at 01:32, Magnus Hagander wrote: > > 1. where was stderr actually sent? To the console, to /dev/null or to a file? To the console (but I can also try other options, although I'm not sure if it would have any impact). > 2. Could you run the same thing (on the same machine) w

Re: [HACKERS] Create replication slot in pg_basebackup if requested and not yet present

2017-09-07 Thread Michael Banck
Hi, Am Mittwoch, den 06.09.2017, 12:22 -0400 schrieb Peter Eisentraut: > On 8/18/17 05:28, Michael Banck wrote: > > > > Rebased, squashed and slighly edited version attached. I've added this > > > > to the 2017-07 commitfest now as well: > > > > > > > > https://commitfest.postgresql.org/14/1112/

Re: [HACKERS] path toward faster partition pruning

2017-09-07 Thread Amit Langote
On 2017/09/08 4:41, Robert Haas wrote: > On Thu, Sep 7, 2017 at 7:16 AM, Amit Langote > wrote: >> There is a patch in the Ashutosh's posted series of patches, which does >> more or less the same thing that this patch does. He included it in his >> series of patches, because, IIUC, the main partit

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

2017-09-07 Thread Michael Paquier
On Fri, Sep 8, 2017 at 7:27 AM, Bossart, Nathan wrote: > On 9/7/17, 2:33 AM, "Michael Paquier" wrote: >> Using the patch checking for duplicate columns: >> =# create table aa (a int); >> CREATE TABLE >> =# vacuum ANALYZE aa(z, z); >> ERROR: 0A000: column lists cannot have duplicate entries >> HI

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

2017-09-07 Thread Amit Langote
On 2017/09/08 14:47, Amit Langote wrote: > When I tried the attached patch, it doesn't seem to expand partitioning > inheritance in step-wise manner as the patch's title says. Oops. By "attached patch", I had meant to say the Robert's patch, that is, expand-stepwise-rmh.patch. Not expand-stepwis

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

2017-09-07 Thread Amit Langote
On 2017/09/08 4:04, Robert Haas wrote: > On Tue, Sep 5, 2017 at 7:01 AM, Ashutosh Bapat > wrote: >> accumulate_append_subpath() is executed for every path instead of >> every relation, so changing it would collect the same list multiple >> times. Instead, I found the old way of associating all int

Re: [HACKERS] psql: new help related to variables are not too readable

2017-09-07 Thread Fabien COELHO
Hello, PSQL_HISTORY alternative location for the command history file I would prefer to revert to that more compact 9.6-formatting. There was a problem with line width .. its hard to respect 80 chars Yes. Scrolling in two dimensions because it does not fit either way is not too p

Re: [HACKERS] Parallel worker error

2017-09-07 Thread Amit Kapila
On Fri, Sep 8, 2017 at 3:18 AM, Robert Haas wrote: > On Mon, Sep 4, 2017 at 5:46 AM, Amit Kapila wrote: >> It seems like the consensus is to move forward with this approach. I >> have written a patch implementing the above idea. Note, that to use >> SetCurrentRoleId, we need the value of guc "i

Re: [HACKERS] psql: new help related to variables are not too readable

2017-09-07 Thread Pavel Stehule
2017-09-08 6:36 GMT+02:00 Erik Rijkers : > On 2017-09-08 06:09, Pavel Stehule wrote: > >> Hi >> >> Now the output looks like: >> >> AUTOCOMMIT >> if set, successful SQL commands are automatically committed >> COMP_KEYWORD_CASE >> determines the case used to complete SQL key words >>

Re: [HACKERS] psql: new help related to variables are not too readable

2017-09-07 Thread Erik Rijkers
On 2017-09-08 06:09, Pavel Stehule wrote: Hi Now the output looks like: AUTOCOMMIT if set, successful SQL commands are automatically committed COMP_KEYWORD_CASE determines the case used to complete SQL key words [lower, upper, preserve-lower, preserve-upper] DBNAME the cur

Re: [HACKERS] Re: proposal - psql: possibility to specify sort for describe commands, when size is printed

2017-09-07 Thread Pavel Stehule
2017-08-16 14:06 GMT+02:00 Pavel Stehule : > Hi > > 2017-08-15 4:37 GMT+02:00 Peter Eisentraut com>: > >> On 3/11/17 07:06, Pavel Stehule wrote: >> > I am sending a updated version with separated sort direction in special >> > variable >> >> This patch also needs a rebase. >> > > I am sending reb

[HACKERS] psql: new help related to variables are not too readable

2017-09-07 Thread Pavel Stehule
Hi Now the output looks like: AUTOCOMMIT if set, successful SQL commands are automatically committed COMP_KEYWORD_CASE determines the case used to complete SQL key words [lower, upper, preserve-lower, preserve-upper] DBNAME the currently connected database name ECHO co

Re: [HACKERS] Tuple-routing for certain partitioned tables not working as expected

2017-09-07 Thread Etsuro Fujita
On 2017/09/08 0:21, Robert Haas wrote: On Thu, Sep 7, 2017 at 5:13 AM, Etsuro Fujita wrote: On 2017/08/30 17:20, Etsuro Fujita wrote: Here is a patch to skip the CheckValidResultRel checks for a target table if it's a foreign partition to perform tuple-routing for, as proposed by Robert. In

Re: [HACKERS] GnuTLS support

2017-09-07 Thread Tom Lane
Andreas Karlsson writes: > On 09/07/2017 11:34 PM, Tomas Vondra wrote: >> Well, people won't be able to set the inactive options, just like you >> can't set ssl=on when you build without OpenSSL support. But perhaps we >> could simply not include the inactive options into the config file, no? > Y

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-09-07 Thread Masahiko Sawada
On Fri, Sep 8, 2017 at 7:24 AM, Thomas Munro wrote: > On Wed, Aug 16, 2017 at 2:13 PM, Masahiko Sawada > wrote: >> The previous patch conflicts with current HEAD, I rebased the patch to >> current HEAD. > > Hi Masahiko-san, > > FYI this doesn't build anymore. I think it's just because the wait

Re: [HACKERS] GnuTLS support

2017-09-07 Thread Andreas Karlsson
On 09/07/2017 11:34 PM, Tomas Vondra wrote: I am worried about having 3x version of TLS controls in postgresql.conf, and only one set being active. Perhaps we need to break out the TLS config to separate files or something. Anyway, this needs more thought. Well, people won't be able to set the

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

2017-09-07 Thread Tom Lane
Simon Riggs writes: > On 7 September 2017 at 11:31, Tom Lane wrote: >> Haas' idea of some kind of syntactic extension, like "LET guc1 = x, >> guc2 = y FOR statement" seems more feasible to me. I'm not necessarily >> wedded to that particular syntax, but I think it has to look like >> a single-st

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

2017-09-07 Thread Tom Lane
Simon Riggs writes: > On 7 September 2017 at 11:24, Tom Lane wrote: >> Not hearing anything, I already pushed my patch an hour or three ago. > Yes, I saw. Are you saying that doc commit is all we need? ISTM we > still had an actual bug. The originally reported bug is fixed. Not making any clai

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

2017-09-07 Thread Robert Haas
On Thu, Sep 7, 2017 at 8:13 AM, Jeevan Ladhe wrote: > The fix would be much easier if the refactoring patch 0001 by Amul in hash > partitioning thread[2] is committed. Done. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers m

Re: [HACKERS] [POC] hash partitioning

2017-09-07 Thread Robert Haas
On Mon, Sep 4, 2017 at 6:38 AM, amul sul wrote: > I've updated patch to use an extended hash function (Commit # > 81c5e46c490e2426db243eada186995da5bb0ba7) for the partitioning. Committed 0001 after noticing that Jeevan Ladhe also found that change convenient for default partitioning. I made a f

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-09-07 Thread Masahiko Sawada
On Fri, Sep 8, 2017 at 8:25 AM, Thomas Munro wrote: > On Fri, Sep 8, 2017 at 10:24 AM, Thomas Munro > wrote: >> On Wed, Aug 16, 2017 at 2:13 PM, Masahiko Sawada >> wrote: >>> The previous patch conflicts with current HEAD, I rebased the patch to >>> current HEAD. >> >> Hi Masahiko-san, > > Hi S

Re: [HACKERS] GSoC 2017: weekly progress reports (week 4) and patch for hash index

2017-09-07 Thread Thomas Munro
Hi Shubham, On Tue, Jun 27, 2017 at 9:21 PM, Shubham Barai wrote: > If these two hash keys (78988658 and 546789888) mapped to the same bucket, > this will result in false serialization failure. > Please correct me if this assumption about false positives is wrong. I wonder if there is an opport

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

2017-09-07 Thread Masahiko Sawada
On Thu, Sep 7, 2017 at 4:15 PM, Fabien COELHO wrote: > >>> Very very minor comments that I should have noticed before, sorry for >>> this >>> additional round trip. >> >> >> Thank you for the dedicated review! > > > I'm someone at times pigheaded, I think in the good sense if it is possible, > and

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

2017-09-07 Thread Simon Riggs
On 7 September 2017 at 11:31, Tom Lane wrote: > Simon Riggs writes: >> I would like to relax the restriction to allow this specific use case... >> SET work_mem = X; SET max_parallel_workers = 4; SELECT ... >> so we still have only one command (the last select), yet we have >> multiple GUC setti

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

2017-09-07 Thread Simon Riggs
On 7 September 2017 at 11:24, Tom Lane wrote: > Simon Riggs writes: >> On 5 September 2017 at 10:22, Tom Lane wrote: >>> Does anyone want to do further review on this patch? If so, I'll >>> set the CF entry back to "Needs Review". > >> OK, I'll review Michael's patch (and confirm my patch is de

Re: [HACKERS] Refactor handling of database attributes between pg_dump and pg_dumpall

2017-09-07 Thread Thomas Munro
On Mon, Aug 21, 2017 at 4:35 PM, Haribabu Kommi wrote: > On Tue, Aug 15, 2017 at 7:29 AM, Peter Eisentraut > wrote: >> On 4/4/17 01:06, Haribabu Kommi wrote: >> > Both pg_dump and pg_upgrade tests are passed. Updated patch attached >> > I will add this patch to the next commitfest. >> >> This pat

Re: [HACKERS] [PATCH] Pattern based listeners for asynchronous messaging (LISTEN/NOTIFY)

2017-09-07 Thread Marko Tiikkaja
Hi Markus, On Sun, Aug 20, 2017 at 9:56 PM, Markus Sintonen wrote: > I also encountered this when I built it with different configuration. I > attached updated patch with the correct number of arguments to > 'similar_escape'. I also added preliminary documentation to the patch. > (Unfortunately

Re: [HACKERS] [PROPOSAL] Use SnapshotAny in get_actual_variable_range

2017-09-07 Thread Tom Lane
I wrote: > Dmitriy Sarafannikov writes: >> [ snapshot_non_vacuumable_v3.patch ] > In short I think we should just set up the threshold as RecentGlobalXmin. Pushed with that adjustment and some fooling with the comments. regards, tom lane -- Sent via pgsql-hackers mail

Re: [HACKERS] log_destination=file

2017-09-07 Thread Magnus Hagander
On Thu, Sep 7, 2017 at 7:02 AM, Tom Lane wrote: > Dmitry Dolgov <9erthali...@gmail.com> writes: > >> On 31 August 2017 at 14:49, Tom Lane wrote: > >> pgbench with log_statement = all would be a pretty easy test case. > > > It seems that for this particular workload it was about 20-25% slower. >

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-09-07 Thread Thomas Munro
On Fri, Sep 8, 2017 at 10:24 AM, Thomas Munro wrote: > On Wed, Aug 16, 2017 at 2:13 PM, Masahiko Sawada > wrote: >> The previous patch conflicts with current HEAD, I rebased the patch to >> current HEAD. > > Hi Masahiko-san, Hi Sawada-san, I have just learned from a colleague who is knowledgea

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-09-07 Thread Thomas Munro
On Wed, Aug 16, 2017 at 2:13 PM, Masahiko Sawada wrote: > The previous patch conflicts with current HEAD, I rebased the patch to > current HEAD. Hi Masahiko-san, FYI this doesn't build anymore. I think it's just because the wait event enumerators were re-alphabetised in pgstat.h: ../../../../s

Re: [HACKERS] [PATCH] Pageinspect - add functions on GIN and GiST indexes from gevel

2017-09-07 Thread Tomas Vondra
Hi, On 07/21/2017 03:40 PM, Alexander Korotkov wrote: > Hi, Alexey! > > On Fri, Jul 21, 2017 at 3:05 PM, Alexey Chernyshov > mailto:a.chernys...@postgrespro.ru>> wrote: > > the following patch transfers functionality from gevel module > (http://www.sai.msu.su/~megera/wiki/Gevel >

Re: [HACKERS] GnuTLS support

2017-09-07 Thread Magnus Hagander
On Thu, Sep 7, 2017 at 2:34 PM, Tomas Vondra wrote: > Hi, > > On 09/04/2017 04:24 PM, Bruce Momjian wrote: > > On Fri, Sep 1, 2017 at 12:09:35PM -0400, Robert Haas wrote: > >> I think that what this shows is that the current set of GUCs is overly > >> OpenSSL-centric. We created a set of GUCs t

Re: [HACKERS] The case for removing replacement selection sort

2017-09-07 Thread Robert Haas
On Thu, Sep 7, 2017 at 5:38 PM, Tomas Vondra wrote: > Do we need/want to repeat some of that benchmarking on these patches? I > don't recall how much this code changed since those benchmarks were done > in the 9.6 cycle. +1 for some new benchmarking. I'm all for removing this code if we don't ne

Re: [HACKERS] Parallel worker error

2017-09-07 Thread Robert Haas
On Mon, Sep 4, 2017 at 5:46 AM, Amit Kapila wrote: > It seems like the consensus is to move forward with this approach. I > have written a patch implementing the above idea. Note, that to use > SetCurrentRoleId, we need the value of guc "is_superuser" for the > current user and we don't pass thi

Re: [HACKERS] The case for removing replacement selection sort

2017-09-07 Thread Tomas Vondra
Hi, On 08/31/2017 02:56 AM, Peter Geoghegan wrote: > On Wed, Aug 30, 2017 at 5:38 PM, Robert Haas wrote: >> Wow. Just to be clear, I am looking for the BEST case for replacement >> selection, not the worst case. But I would have expected that case to >> be a win for replacement selection, and i

Re: [HACKERS] GnuTLS support

2017-09-07 Thread Tomas Vondra
Hi, On 09/04/2017 04:24 PM, Bruce Momjian wrote: > On Fri, Sep 1, 2017 at 12:09:35PM -0400, Robert Haas wrote: >> I think that what this shows is that the current set of GUCs is overly >> OpenSSL-centric. We created a set of GUCs that are actually specific >> to one particular implementation but

Re: [HACKERS] [PROPOSAL] Use SnapshotAny in get_actual_variable_range

2017-09-07 Thread Tom Lane
Dmitriy Sarafannikov writes: > [ snapshot_non_vacuumable_v3.patch ] Starting to look at this. I think that the business with choosing RecentGlobalXmin vs. RecentGlobalDataXmin is just wrong. What we want to do is accept any tuple that would not be considered killable by heap_hot_search_buffer,

Re: [HACKERS] Remove 1MB size limit in tsvector

2017-09-07 Thread Tomas Vondra
Hi, On 08/17/2017 12:23 PM, Ildus Kurbangaliev wrote: > In my benchmarks when database fits into buffers (so it's measurement of > the time required for the tsvectors conversion) it gives me these > results: > > Without conversion: > > $ ./tsbench2 -database test1 -bench_time 300 > 2017/08/17 12

Re: [HACKERS] Hooks to track changed pages for backup purposes

2017-09-07 Thread Tomas Vondra
Hi, On 09/01/2017 08:13 AM, Andrey Borodin wrote: > Thank you for your reply, Michael! Your comments are valuable, especially in the world of backups. > >> 31 авг. 2017 г., в 19:44, Michael Paquier написал(а): >> Such things are not Postgres-C like. > Will be fixed. > A few more comments: * The

Re: [HACKERS] Setting pd_lower in GIN metapage

2017-09-07 Thread Tom Lane
Michael Paquier writes: > On Thu, Sep 7, 2017 at 2:40 PM, Amit Langote > wrote: >> On 2017/09/07 13:09, Michael Paquier wrote: >>> pd_lower should remain at 0 on pre-10 servers. >> Doesn't PageInit(), which is where any page gets initialized, has always >> set pd_lower to SizeOfPageHeaderData?

Re: [HACKERS] psql - add special variable to reflect the last query status

2017-09-07 Thread Fabien COELHO
Hello Pavel, I checked performance - the most fast queries are execution of simple prepared statement prepare x as select 1; -- 100 x execute x; execute x; execute x; execute x; ## patched [pavel@nemesis postgresql]$ time psql -At -1 postgres -f ~/xxx.sql > /dev/null real 0m44,887s user

Re: [HACKERS] PATCH: multivariate histograms and MCV lists

2017-09-07 Thread Tomas Vondra
Hi, Attached is an updated version of the patch, fixing the issues reported by Adrien Nayrat, and also a bunch of issues pointed out by valgrind. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services 0001-MCV-

Re: [HACKERS] path toward faster partition pruning

2017-09-07 Thread Robert Haas
On Thu, Sep 7, 2017 at 7:16 AM, Amit Langote wrote: > There is a patch in the Ashutosh's posted series of patches, which does > more or less the same thing that this patch does. He included it in his > series of patches, because, IIUC, the main partitionwise-join planning > logic that one of the

Re: [HACKERS] PoC plpgsql - possibility to force custom or generic plan

2017-09-07 Thread Pavel Stehule
> > > > Hmm. I think the core problem here is that we're trying to control > > the plancache, which is a pretty much behind-the-scenes mechanism. > > Except in the case of an explicit PREPARE, you can't even see from > > SQL that the cache is being used, or when it's used. So part of what > > nee

Re: [HACKERS] psql - add special variable to reflect the last query status

2017-09-07 Thread Pavel Stehule
Hi 2017-09-06 11:14 GMT+02:00 Fabien COELHO : > > Here is a version 6. >> > > Small v7 update, sorry for the noise. > > Add testing the initial state of all variables. > > Fix typos in a comment in tests. > > Fix the documentation wrt the current implementation behavior. I rechecked last patch

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

2017-09-07 Thread Robert Haas
On Tue, Sep 5, 2017 at 7:01 AM, Ashutosh Bapat wrote: > accumulate_append_subpath() is executed for every path instead of > every relation, so changing it would collect the same list multiple > times. Instead, I found the old way of associating all intermediate > partitions with the root partition

Re: [HACKERS] assorted code cleanup

2017-09-07 Thread Tom Lane
Peter Eisentraut writes: > On 9/5/17 15:32, Tom Lane wrote: >> I do agree with the idea that we should use the * notation in cases where >> the reader might otherwise think that a plain function was being invoked, >> ie I don't like >> some_function_pointer(args); >> Even if the compiler isn't con

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

2017-09-07 Thread Tom Lane
Simon Riggs writes: > I would like to relax the restriction to allow this specific use case... > SET work_mem = X; SET max_parallel_workers = 4; SELECT ... > so we still have only one command (the last select), yet we have > multiple GUC settings beforehand. On what basis do you claim that's on

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

2017-09-07 Thread Tom Lane
Simon Riggs writes: > On 5 September 2017 at 10:22, Tom Lane wrote: >> Does anyone want to do further review on this patch? If so, I'll >> set the CF entry back to "Needs Review". > OK, I'll review Michael's patch (and confirm my patch is dead) Not hearing anything, I already pushed my patch a

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

2017-09-07 Thread Simon Riggs
On 7 September 2017 at 11:07, Tom Lane wrote: > I wrote: >> Yeah, it seems like we have now made this behavior official enough that >> it's time to document it better. My thought is to create a new subsection >> in the FE/BE Protocol chapter that explains how multi-statement Query >> messages are

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

2017-09-07 Thread Simon Riggs
On 5 September 2017 at 10:22, Tom Lane wrote: > Michael Paquier writes: >> On Mon, Sep 4, 2017 at 11:15 PM, Tom Lane wrote: >>> I don't want to go there, and was thinking we should expand the new >>> comment in DefineSavepoint to explain why not. > >> Okay. > > Does anyone want to do further rev

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

2017-09-07 Thread Tom Lane
I wrote: > Yeah, it seems like we have now made this behavior official enough that > it's time to document it better. My thought is to create a new subsection > in the FE/BE Protocol chapter that explains how multi-statement Query > messages are handled, and then to link to that from appropriate p

Re: [HACKERS] assorted code cleanup

2017-09-07 Thread Peter Eisentraut
On 9/5/17 15:32, Tom Lane wrote: > At one time there were C compilers that only accepted the former syntax. Correct. Explanation here: http://c-faq.com/ptrs/funccall.html > I do agree with the idea that we should use the * notation in cases where > the reader might otherwise think that a plain f

Re: [HACKERS] Re: issue: record or row variable cannot be part of multiple-item INTO list

2017-09-07 Thread Pavel Stehule
2017-09-07 19:48 GMT+02:00 Pavel Stehule : > > > 2017-09-07 8:08 GMT+02:00 Anthony Bykov : > >> The following review has been posted through the commitfest application: >> make installcheck-world: not tested >> Implements feature: not tested >> Spec compliant: not tested >> Docume

Re: [HACKERS] Re: issue: record or row variable cannot be part of multiple-item INTO list

2017-09-07 Thread Pavel Stehule
2017-09-07 8:08 GMT+02:00 Anthony Bykov : > The following review has been posted through the commitfest application: > make installcheck-world: not tested > Implements feature: not tested > Spec compliant: not tested > Documentation:not tested > > I'm afraid this patch

Re: [HACKERS] Secondary index access optimizations

2017-09-07 Thread Konstantin Knizhnik
On 07.09.2017 13:00, Thomas Munro wrote: On Sun, Sep 3, 2017 at 4:34 AM, Konstantin Knizhnik wrote: Thank you for review. I attached new version of the patch with remove_restrictions_implied_by_constraints() function. Concerning failed tests - this is actually result of this optimization: ext

Re: [HACKERS] logical decoding of two-phase transactions

2017-09-07 Thread Nikhil Sontakke
Hi, FYI all, wanted to mention that I am working on an updated version of the latest patch that I plan to submit to a later CF. Regards, Nikhils On 14 May 2017 at 04:02, Dmitry Dolgov <9erthali...@gmail.com> wrote: > On 13 May 2017 at 22:22, Tom Lane wrote: >> >> Apparently you are not testing

Re: [HACKERS] Setting pd_lower in GIN metapage

2017-09-07 Thread Robert Haas
On Wed, Sep 6, 2017 at 9:42 PM, Amit Langote wrote: > I too tend to think that any users who use this masking facility would > know to expect to get these failures on upgraded clusters with invalid > pd_lower in meta pages. I strongly disagree. -- Robert Haas EnterpriseDB: http://www.enterprise

Re: [HACKERS] Tuple-routing for certain partitioned tables not working as expected

2017-09-07 Thread Robert Haas
On Thu, Sep 7, 2017 at 5:13 AM, Etsuro Fujita wrote: > On 2017/08/30 17:20, Etsuro Fujita wrote: >> Here is a patch to skip the CheckValidResultRel checks for a target table >> if it's a foreign partition to perform tuple-routing for, as proposed by >> Robert. > > In the patch, to skip the checks,

Re: [HACKERS] Proposal: pg_rewind to skip config files

2017-09-07 Thread Chris Travers
On Thu, Sep 7, 2017 at 2:47 PM, Alvaro Herrera wrote: > After reading this discussion, I agree that pg_rewind needs to become > smarter in order to be fully useful in production environments; right > now there are many warts and corner cases that did not seem to have been > considered during the

Re: [HACKERS] 【ECPG】strncpy function does not set the end character '\0'

2017-09-07 Thread Michael Meskes
> Oh. If there's actually a standard somewhere that says it's not > null-terminated, then code that is expecting it to be so is just > wrong. No need to change anything in ecpg, IMO. As I said I haven't checked if this detail is actually in there, but I guess it was because there is a reason why

Re: [HACKERS] 【ECPG】strncpy function does not set the end character '\0'

2017-09-07 Thread Tom Lane
Michael Meskes writes: > With "supposed" I was referring to the standard that defines SQLCA. Oh. If there's actually a standard somewhere that says it's not null-terminated, then code that is expecting it to be so is just wrong. No need to change anything in ecpg, IMO.

Re: [HACKERS] 【ECPG】strncpy function does not set the end character '\0'

2017-09-07 Thread Michael Meskes
> > Why do you think there should be one? My memory might be wrong but > > I > > don't think it's supposed to be a null terminated string. > > That field is defined as char[5] in struct sqlca_t, so the intent is > clearly that it not be null terminated. However, it looks to me like > there'd be a

Re: [HACKERS] WIP: Aggregation push-down

2017-09-07 Thread Merlin Moncure
On Thu, Aug 17, 2017 at 10:22 AM, Antonin Houska wrote: > Antonin Houska wrote: > output type. For other aggregates (like avg()) the remote nodes will have to > return the transient state value in an appropriate form (maybe bytea type), > which does not depend on PG version. Hm, that seems like

Re: [HACKERS] advanced partition matching algorithm for partition-wise join

2017-09-07 Thread Antonin Houska
Ashutosh Bapat wrote: > I have fixed the issues which were marked as TODOs in the attached > patches. Also, I have included your test change patch in my series of > patches. I've noticed that partition_bounds_merge() is called twice from make_join_rel(): * build_join_rel -> build_joinrel_parti

Re: [HACKERS] log_destination=file

2017-09-07 Thread Tom Lane
Dmitry Dolgov <9erthali...@gmail.com> writes: >> On 31 August 2017 at 14:49, Tom Lane wrote: >> pgbench with log_statement = all would be a pretty easy test case. > It seems that for this particular workload it was about 20-25% slower. Ouch. That seems like rather a large hit :-(. I actually e

Re: [HACKERS] Create replication slot in pg_basebackup if requested and not yet present

2017-09-07 Thread Michael Banck
Hi, not directly related to the topic, but: On Tue, Mar 21, 2017 at 03:34:00PM -0400, Robert Haas wrote: > For example, somebody creates a replica using the new super-easy > method, and then blows it away without dropping the slot from the > master, Just a thought, but maybe there should be som

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

2017-09-07 Thread Tom Lane
Catalin Iacob writes: > On Mon, Sep 4, 2017 at 4:15 PM, Tom Lane wrote: >> Also, the main thing that we need xact.c's involvement for in the first >> place is the fact that implicit transaction blocks, unlike regular ones, >> auto-cancel on an error, leaving you outside a block not inside a faile

Re: [HACKERS] log_destination=file

2017-09-07 Thread Dmitry Dolgov
Hi > On 31 August 2017 at 14:49, Tom Lane wrote: >> Are you actually asking for a benchmark of if logging gets slower? > > Yes. > >> If so, >> could you suggest a workload to make an actual benchmark of it (where >> logging would be high enough that it could be come a bottleneck -- and not >> wri

Re: [HACKERS] index-only count(*) for indexes supporting bitmap scans

2017-09-07 Thread Alexey Chernyshov
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed One thing I have noticed is a trailing whitespace after "bogu

Re: [HACKERS] Restricting maximum keep segments by repslots

2017-09-07 Thread Kyotaro HORIGUCHI
Hello, At Thu, 07 Sep 2017 14:12:12 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20170907.141212.227032666.horiguchi.kyot...@lab.ntt.co.jp> > > I would like a flag in pg_replication_slots, and possibly also a > > numerical column that indicates how far away from the critical point >

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

2017-09-07 Thread Ashutosh Bapat
On Wed, Sep 6, 2017 at 5:50 PM, Jeevan Ladhe wrote: > >> >> I am wondering whether we could avoid call to get_default_partition_oid() >> in >> the above block, thus avoiding a sys cache lookup. The sys cache search >> shouldn't be expensive since the cache should already have that entry, but >> st

Re: [HACKERS] Proposal: pg_rewind to skip config files

2017-09-07 Thread Alvaro Herrera
After reading this discussion, I agree that pg_rewind needs to become smarter in order to be fully useful in production environments; right now there are many warts and corner cases that did not seem to have been considered during the initial development (which I think is all right, taking into acc

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

2017-09-07 Thread Ashutosh Bapat
On Thu, Sep 7, 2017 at 4:32 PM, Antonin Houska wrote: > Ashutosh Bapat wrote: > >> On Fri, Sep 1, 2017 at 6:05 PM, Antonin Houska wrote: >> > >> > >> > >> > * get_partitioned_child_rels_for_join() >> > >> > I think the Assert() statement is easier to understand inside the loop, see >> > the asse

Re: [HACKERS] path toward faster partition pruning

2017-09-07 Thread Amit Langote
Forgot to mention a couple of important points about the relation of some of the patches here to the patches and discussion at the partitionwise-join thread [1]. On 2017/09/06 19:38, Amit Langote wrote: > [PATCH 1/5] Expand partitioned inheritance in a non-flattened manner > > This will allow us

Re: [HACKERS] WIP: Aggregation push-down

2017-09-07 Thread Ashutosh Bapat
On Thu, Aug 17, 2017 at 8:52 PM, Antonin Houska wrote: > Antonin Houska wrote: > >> Antonin Houska wrote: >> >> > This is a new version of the patch I presented in [1]. >> >> Rebased. >> >> cat .git/refs/heads/master >> b9a3ef55b253d885081c2d0e9dc45802cab71c7b > > This is another version of the

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

2017-09-07 Thread Antonin Houska
Ashutosh Bapat wrote: > On Fri, Sep 1, 2017 at 6:05 PM, Antonin Houska wrote: > > > > > > > > * get_partitioned_child_rels_for_join() > > > > I think the Assert() statement is easier to understand inside the loop, see > > the assert.diff attachment. > The assert at the end of function also chec

Re: [HACKERS] UPDATE of partition key

2017-09-07 Thread Amit Khandekar
On 3 September 2017 at 17:10, Amit Khandekar wrote: > After recent commit 30833ba154, now the partitions are expanded in > depth-first order. It didn't seem worthwhile rebasing my partition > walker changes onto the latest code. So in the attached patch, I have > removed all the partition walker

Re: [HACKERS] Secondary index access optimizations

2017-09-07 Thread Thomas Munro
On Sun, Sep 3, 2017 at 4:34 AM, Konstantin Knizhnik wrote: > Thank you for review. > I attached new version of the patch with > remove_restrictions_implied_by_constraints() function. > Concerning failed tests - this is actually result of this optimization: > extra filter conditions are removed fro

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

2017-09-07 Thread Jeevan Ladhe
On Thu, Sep 7, 2017 at 3:15 PM, Rajkumar Raghuwanshi < rajkumar.raghuwan...@enterprisedb.com> wrote: > On Wed, Sep 6, 2017 at 5:25 PM, Jeevan Ladhe < > jeevan.la...@enterprisedb.com> wrote: > >> Hi, >> >> Attached is the rebased set of patches. >> Robert has committed[1] patch 0001 in V26 series,

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

2017-09-07 Thread Rajkumar Raghuwanshi
On Wed, Sep 6, 2017 at 5:25 PM, Jeevan Ladhe wrote: > Hi, > > Attached is the rebased set of patches. > Robert has committed[1] patch 0001 in V26 series, hence the patch numbering > in V27 is now decreased by 1 for each patch as compared to V26. > Hi, I have applied v27 patches and while testin

Re: [HACKERS] Re: [COMMITTERS] pgsql: pg_rewind: Fix some problems when copying files >2GB.

2017-09-07 Thread Alvaro Herrera
Peter Eisentraut wrote: > On 9/4/17 06:03, Alvaro Herrera wrote: > > Tom Lane wrote: > >> Michael Paquier writes: > >>> I don't like breaking the abstraction of pg_log() with the existing > >>> flags with some kind of pg_debug() layer. The set of APIs present now > >>> in pg_rewind for logging is

Re: [HACKERS] Tuple-routing for certain partitioned tables not working as expected

2017-09-07 Thread Etsuro Fujita
On 2017/08/30 17:20, Etsuro Fujita wrote: Here is a patch to skip the CheckValidResultRel checks for a target table if it's a foreign partition to perform tuple-routing for, as proposed by Robert. In the patch, to skip the checks, I passed to CheckValidResultRel a new flag indicating whether

Re: [HACKERS] WIP: Aggregation push-down

2017-09-07 Thread Jeevan Chalke
Hi Antonin, To understand the feature you have proposed, I have tried understanding your patch. Here are few comments so far on it: 1. + if (aggref->aggvariadic || + aggref->aggdirectargs || aggref->aggorder || + aggref->aggdistinct || aggref->aggfilter) I did not

Re: [HACKERS] Parallel Append implementation

2017-09-07 Thread Amit Khandekar
On 7 September 2017 at 13:40, Rafia Sabih wrote: > On Wed, Aug 30, 2017 at 5:32 PM, Amit Khandekar > wrote: >> Hi Rafia, >> >> On 17 August 2017 at 14:12, Amit Khandekar wrote: >>> But for all of the cases here, partial >>> subplans seem possible, and so even on HEAD it executed Partial >>> App

Re: [HACKERS] Parallel Append implementation

2017-09-07 Thread Rafia Sabih
On Wed, Aug 30, 2017 at 5:32 PM, Amit Khandekar wrote: > Hi Rafia, > > On 17 August 2017 at 14:12, Amit Khandekar wrote: >> But for all of the cases here, partial >> subplans seem possible, and so even on HEAD it executed Partial >> Append. So between a Parallel Append having partial subplans and

Re: [HACKERS] Re: [COMMITTERS] pgsql: pg_rewind: Fix some problems when copying files >2GB.

2017-09-07 Thread Alvaro Herrera
Peter Eisentraut wrote: > On 9/4/17 06:03, Alvaro Herrera wrote: > > Tom Lane wrote: > >> Michael Paquier writes: > >>> I don't like breaking the abstraction of pg_log() with the existing > >>> flags with some kind of pg_debug() layer. The set of APIs present now > >>> in pg_rewind for logging is

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

2017-09-07 Thread Michael Paquier
On Thu, Sep 7, 2017 at 9:46 AM, Bossart, Nathan wrote: > I've attached v1 of this patch. I think we might want to refactor the > code for retrieving the relation name from a RangeVar, but it would > probably be better to do that in a separate patch. Using the patch checking for duplicate columns

Re: [HACKERS] Making clausesel.c Smarter

2017-09-07 Thread Daniel Gustafsson
> On 06 Sep 2017, at 07:13, David Rowley wrote: > > On 6 September 2017 at 00:43, Daniel Gustafsson wrote: >> This patch was moved to the currently open Commitfest. Given the above >> comment, is the last patch in this thread still up for review, or are you >> working on a new version? Just t

Re: [HACKERS] Proposal: pg_rewind to skip config files

2017-09-07 Thread Chris Travers
One more side to this which is relevant to other discussions. If I am rewinding back to before when a table was created, the current algorithm as well as any proposed algorithms will delete the reference to the relfilenode in the catalogs but not the file itself. I don't see how an undo subsystem

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

2017-09-07 Thread Fabien COELHO
Very very minor comments that I should have noticed before, sorry for this additional round trip. Thank you for the dedicated review! I'm someone at times pigheaded, I think in the good sense if it is possible, and I like to finish what I start:-) Patch applies, compiles, works, everythin