Re: [HACKERS] Speed up Clog Access by increasing CLOG buffers

2016-11-02 Thread Amit Kapila
On Wed, Nov 2, 2016 at 9:01 AM, Tomas Vondra wrote: > On 11/01/2016 08:13 PM, Robert Haas wrote: >> >> On Mon, Oct 31, 2016 at 5:48 PM, Tomas Vondra >> wrote: >>> > > The one remaining thing is the strange zig-zag behavior, but that

Re: [HACKERS] Speed up Clog Access by increasing CLOG buffers

2016-11-02 Thread Tomas Vondra
On 11/02/2016 05:52 PM, Amit Kapila wrote: On Wed, Nov 2, 2016 at 9:01 AM, Tomas Vondra wrote: On 11/01/2016 08:13 PM, Robert Haas wrote: On Mon, Oct 31, 2016 at 5:48 PM, Tomas Vondra wrote: The one remaining thing is the

Re: [HACKERS] pageinspect: Hash index support

2016-11-02 Thread Tom Lane
Peter Eisentraut writes: > So, we're down to crashes in gin_metapage_info() on ia64 and sparc64. > My guess is that the raw page data that is passed into the function > needs to be 8-byte aligned before being accessed as GinMetaPageData. That's what it looks

Re: [HACKERS] Patch: Implement failover on libpq connect level.

2016-11-02 Thread Mithun Cy
On Tue, Nov 1, 2016 at 9:42 PM, Robert Haas wrote: > Ah, nuts. Thanks, good catch. Should be fixed in the attached version. I repeated the test on new patch, It works fine now, Also did some more negative tests forcibly failing some internal calls. All tests have passed.

Re: [HACKERS] pageinspect: Hash index support

2016-11-02 Thread Peter Eisentraut
On 11/1/16 3:28 PM, Peter Eisentraut wrote: > I have also committed the tests > that I proposed and will work through the failures. So, we're down to crashes in gin_metapage_info() on ia64 and sparc64. My guess is that the raw page data that is passed into the function needs to be 8-byte aligned

Re: [HACKERS] Speed up Clog Access by increasing CLOG buffers

2016-11-02 Thread Tomas Vondra
On 11/02/2016 05:52 PM, Amit Kapila wrote: On Wed, Nov 2, 2016 at 9:01 AM, Tomas Vondra wrote: On 11/01/2016 08:13 PM, Robert Haas wrote: On Mon, Oct 31, 2016 at 5:48 PM, Tomas Vondra wrote: The one remaining thing is the

Re: [HACKERS] delta relations in AFTER triggers

2016-11-02 Thread Kevin Grittner
> 2016-11-02 15:57 GMT+01:00 Kevin Grittner : >> On Sun, Oct 30, 2016 at 10:35 AM, Kevin Grittner wrote: >> >>> SPI support would also >>> allow us to consider using set logic for validating foreign keys, >>> instead of the one-row-at-a-time approach

[HACKERS] plan_rows confusion with parallel queries

2016-11-02 Thread Tomas Vondra
Hi, while eye-balling some explain plans for parallel queries, I got a bit confused by the row count estimates. I wonder whether I'm alone. Consider for example a simple seq scan query, which in non-parallel explain looks like this: QUERY PLAN

Re: [HACKERS] plan_rows confusion with parallel queries

2016-11-02 Thread Tom Lane
Tomas Vondra writes: > while eye-balling some explain plans for parallel queries, I got a bit > confused by the row count estimates. I wonder whether I'm alone. I got confused by that a minute ago, so no you're not alone. The problem is even worse in join cases.

Re: [HACKERS] Declarative partitioning - another take

2016-11-02 Thread Amit Langote
On 2016/11/02 2:44, Robert Haas wrote: > On Fri, Oct 28, 2016 at 3:53 AM, Amit Langote > wrote: >>> Insisting that you can't drop a child without detaching it first seems >>> wrong to me. If I already made this comment and you responded to it, >>> please point me

Re: [HACKERS] delta relations in AFTER triggers

2016-11-02 Thread Adam Brusselback
> > There may be some situations where crawling the indexes a row at a > time will perform better than this by enough to want to retain that > option. If an index existed, wouldn't it still be able to use that in the set-based implementation? Is there something which would make doing the check

Re: [HACKERS] WAL consistency check facility

2016-11-02 Thread Michael Paquier
On Wed, Nov 2, 2016 at 11:30 PM, Kuntal Ghosh wrote: > On Wed, Nov 2, 2016 at 1:11 PM, Kuntal Ghosh > wrote: >> Rest of the suggestions are well-taken. I'll update the patch accordingly. > I've updated the last submitted patch(v10) with

Re: [HACKERS] plan_rows confusion with parallel queries

2016-11-02 Thread Tomas Vondra
On 11/02/2016 09:00 PM, Tom Lane wrote: Tomas Vondra writes: while eye-balling some explain plans for parallel queries, I got a bit confused by the row count estimates. I wonder whether I'm alone. I got confused by that a minute ago, so no you're not alone. The

[HACKERS] Making table reloading easier

2016-11-02 Thread Craig Ringer
Hi all A very common operation that users perform is reloading tables. Sometimes as part of an ETL process. Sometimes as part of a dump and reload. Sometimes loading data from external DBs, etc. Right now users have to jump through a bunch of hoops to do this efficiently: BEGIN; TRUNCATE TABLE

[HACKERS] who calls InitializeTimeouts() ?

2016-11-02 Thread Chapman Flack
Hi, It looks like for about 3 years, PL/Java has been calling InitializeTimeouts before calling RegisterTimeout. Looking over the callers of InitializeTimeouts in core, though, it appears that an extension like PL/Java should be able to assume it has already been called, and in fact would be rude

[HACKERS] Re: [BUGS] BUG #14350: VIEW with INSTEAD OF INSERT TRIGGER and COPY. Missing feature or working as designed.

2016-11-02 Thread Haribabu Kommi
On Tue, Nov 1, 2016 at 8:05 PM, Dilip Kumar wrote: > On Tue, Nov 1, 2016 at 12:40 PM, Haribabu Kommi > wrote: > > COPY command is treated as an UTILITY command, During the query > > processing, the rules are not applied on the COPY command, and

[HACKERS] Row level security implementation in Foreign Table in Postgres

2016-11-02 Thread Sounak Chakraborty
Row level security feature implementation in Postgres is through policy and the row security qualifier is attached as a subquery to the main query before query planning. The RLS is implemented through ALTER TABLE STATEMENT. But my doubt is why this feature is not enabled in case of Foreign

Re: [HACKERS] plan_rows confusion with parallel queries

2016-11-02 Thread Tom Lane
Tomas Vondra writes: > On 11/02/2016 11:56 PM, Tomas Vondra wrote: >> On 11/02/2016 09:00 PM, Tom Lane wrote: >>> Tomas Vondra writes: while eye-balling some explain plans for parallel queries, I got a bit confused by the row

Re: [HACKERS] about missing xml related functionnalities

2016-11-02 Thread Craig Ringer
On 2 November 2016 at 21:12, Jean-Paul Jorda wrote: > Hi, > I send this email after reading the xml2 module « Deprecation notice » in > https://www.postgresql.org/docs/9.6/static/xml2.html. > > I still use xml2 module for one thing: xslt_process(). We store some >

Re: [HACKERS] plan_rows confusion with parallel queries

2016-11-02 Thread Tomas Vondra
On 11/02/2016 11:56 PM, Tomas Vondra wrote: On 11/02/2016 09:00 PM, Tom Lane wrote: Tomas Vondra writes: while eye-balling some explain plans for parallel queries, I got a bit confused by the row count estimates. I wonder whether I'm alone. I got confused by

Re: [HACKERS] Patch to implement pg_current_logfile() function

2016-11-02 Thread Karl O. Pinc
On Wed, 2 Nov 2016 10:07:34 +0100 Gilles Darold wrote: > Please have a look at line 1137 on HEAD of syslogger.c you will see > that in case of failure function logfile_open() report a FATAL or LOG > error with message: > > errmsg("could not open log file \"%s\":

Re: [HACKERS] Proposal: scan key push down to heap [WIP]

2016-11-02 Thread Dilip Kumar
On Sat, Oct 29, 2016 at 12:17 PM, Dilip Kumar wrote: > What about putting slot reference inside HeapScanDesc ?. I know it > will make ,heap layer use executor structure but just a thought. > > I have quickly hacked this way where we use slot reference in > HeapScanDesc and

Re: [HACKERS] make coverage-html on OS X

2016-11-02 Thread Peter Eisentraut
On 10/29/16 4:31 PM, Jim Nasby wrote: > tl;dr: It's critical that you actually do a make install, or at least it > is if you've set --prefix with configure. If you don't, then even if you > do make check you'le going to get the *installed* libpq, and not the > *built* libpq. I was not able to

Re: [HACKERS] Transactions involving multiple postgres foreign servers

2016-11-02 Thread Ashutosh Bapat
On Mon, Oct 31, 2016 at 6:17 AM, Masahiko Sawada wrote: > On Fri, Oct 28, 2016 at 3:19 AM, Robert Haas wrote: >> On Wed, Oct 26, 2016 at 2:00 AM, Masahiko Sawada >> wrote: >>> I think we can consider the atomic commit and the

Re: [HACKERS] Patch to implement pg_current_logfile() function

2016-11-02 Thread Karl O. Pinc
On Wed, 2 Nov 2016 07:55:45 -0500 "Karl O. Pinc" wrote: > On Wed, 2 Nov 2016 10:07:34 +0100 > Gilles Darold wrote: > > > Please have a look at line 1137 on HEAD of syslogger.c > Ok. Thanks. Sorry for the confusion. And yes, we did talk about this

Re: [HACKERS] delta relations in AFTER triggers

2016-11-02 Thread Kevin Grittner
On Sun, Oct 30, 2016 at 10:35 AM, Kevin Grittner wrote: > SPI support would also > allow us to consider using set logic for validating foreign keys, > instead of the one-row-at-a-time approach currently used. Just as a proof of concept for this I used the attached test case

[HACKERS] about missing xml related functionnalities

2016-11-02 Thread Jean-Paul Jorda
Hi, I send this email after reading the xml2 module « Deprecation notice » in https://www.postgresql.org/docs/9.6/static/xml2.html. I still use xml2 module for one thing: xslt_process(). We store some data in xml fields, and we sometime need to correct / upgrade the format. Being able to apply a

Re: [HACKERS] Using a latch between a background worker process and a thread

2016-11-02 Thread Craig Ringer
On 2 November 2016 at 02:10, Robert Haas wrote: > On Tue, Nov 1, 2016 at 12:35 PM, Abbas Butt > wrote: >> Hi, >> Consider this situation: >> 1. I have a background worker process. >> 2. The process creates a latch, initializes it using

Re: [HACKERS] sequences and pg_upgrade

2016-11-02 Thread Michael Paquier
On Mon, Oct 31, 2016 at 9:53 PM, Peter Eisentraut wrote: > On 9/30/16 12:50 PM, Anastasia Lubennikova wrote: >> The patches are good, no complaints. >> But again, I have the same question. >> I was confused, why do we always dump sequence data, >> because I'd

Re: [HACKERS] Specifying the log file name of pgbench -l option

2016-11-02 Thread Beena Emerson
Hello, On Wed, Nov 2, 2016 at 4:16 AM, Fabien COELHO wrote: > > Hello Masahiko, > > So I would suggest to: >>> - fix the compilation issue >>> - leave -l/--log as it is, i.e. use "pgbench_log" as a prefix >>> - add --log-prefix=... (long option only) for changing this

Re: [HACKERS] WAL consistency check facility

2016-11-02 Thread Kuntal Ghosh
On Wed, Nov 2, 2016 at 1:11 PM, Kuntal Ghosh wrote: > Rest of the suggestions are well-taken. I'll update the patch accordingly. I've updated the last submitted patch(v10) with the following changes: - added a block level flag BKPIMAGE_APPLY to distinguish backup image

Re: [HACKERS] delta relations in AFTER triggers

2016-11-02 Thread Kevin Grittner
Attached is a minor fix to go on top of transition-tsr for issues found yesterday in testing. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c index 53bfd4b..2da841e

Re: [HACKERS] delta relations in AFTER triggers

2016-11-02 Thread Pavel Stehule
2016-11-02 15:57 GMT+01:00 Kevin Grittner : > On Sun, Oct 30, 2016 at 10:35 AM, Kevin Grittner > wrote: > > > SPI support would also > > allow us to consider using set logic for validating foreign keys, > > instead of the one-row-at-a-time approach currently

Re: [HACKERS] emergency outage requiring database restart

2016-11-02 Thread Oskari Saarenmaa
26.10.2016, 21:34, Andres Freund kirjoitti: Any chance that plsh or the script it executes does anything with the file descriptors it inherits? That'd certainly one way to get into odd corruption issues. We processor really should use O_CLOEXEC for the majority of it file handles. Attached

Re: [HACKERS] Logical Replication WIP

2016-11-02 Thread Peter Eisentraut
On 10/24/16 9:22 AM, Petr Jelinek wrote: > I added one more prerequisite patch (the first one) which adds ephemeral > slots (or well implements UI on top of the code that was mostly already > there). The ephemeral slots are different in that they go away either on > error or when session is

Re: [HACKERS] split up psql \d Modifiers column

2016-11-02 Thread Kuntal Ghosh
On Fri, Oct 28, 2016 at 9:00 AM, Peter Eisentraut wrote: > I propose to change the psql \d output a bit, best shown with an example: > > \d persons3 > - Table "public.persons3" > - Column | Type |Modifiers > -+-+-- >

[HACKERS] Substantial bloat in postgres_fdw regression test runtime

2016-11-02 Thread Tom Lane
In 9.6, "make installcheck" in contrib/postgres_fdw takes a shade under 3 seconds on my machine. In HEAD, it's taking 10 seconds. I am not happy, especially not since there's no parallelization of the contrib regression tests. That's a direct consumption of my time and all other developers' time

Re: [HACKERS] delta relations in AFTER triggers

2016-11-02 Thread Adam Brusselback
> > The delete of about one million rows from a "parent" table with no > matching rows in the "child" table, and no index on referencing > column in the child table, took 24:17.969 using current triggers > and 00:03.262 using the set-based triggers. Yes, that reduces > current run time for that

Re: [HACKERS] pageinspect: Hash index support

2016-11-02 Thread Jesper Pedersen
On 11/01/2016 03:28 PM, Peter Eisentraut wrote: Ok, thanks for your feedback. Maybe "Returned with Feedback" is more appropriate, as there is still development left. I have applied the documentation change that introduced subsections, which seems quite useful independently. I have also

Re: [HACKERS] auto_explain vs. parallel query

2016-11-02 Thread Tomas Vondra
On 11/01/2016 08:32 PM, Robert Haas wrote: On Tue, Nov 1, 2016 at 10:58 AM, Tomas Vondra wrote: Damn! You're right of course. Who'd guess I need more coffee this early? Attached is a fix replacing the flag with an array of flags, indexed by

Re: [HACKERS] Declarative partitioning - another take

2016-11-02 Thread Amit Langote
On 2016/11/02 16:41, Amit Langote wrote: > Having said all that, I am open to switching to the catalogued partition > constraints if the arguments I make above in favor of this patch are not > all that sound. One problem I didn't immediately see a solution for if we go with the catalogued

[HACKERS] Re: [COMMITTERS] pgsql: Add make rules to download raw Unicode mapping files

2016-11-02 Thread Michael Paquier
On Wed, Nov 2, 2016 at 12:58 AM, Peter Eisentraut wrote: > Add make rules to download raw Unicode mapping files > > This serves as implicit documentation and is handy if someone wants to > tweak things. The rules are not part of a normal build, like this > entire directory. If

Re: [HACKERS] Declarative partitioning - another take

2016-11-02 Thread Amit Langote
On 2016/11/02 2:34, Robert Haas wrote: > On Fri, Oct 28, 2016 at 3:53 AM, Amit Langote > wrote: >> [ new patches ] > > Reviewing 0006: Thanks for the review! > This patch seems scary. I sort of assumed from the title -- "Teach a > few places to use partition

Re: [HACKERS] WAL consistency check facility

2016-11-02 Thread Kuntal Ghosh
On Wed, Nov 2, 2016 at 10:23 AM, Michael Paquier wrote: > On Tue, Nov 1, 2016 at 10:31 PM, Robert Haas wrote: >> IMHO, your rewrite of this patch was a bit heavy-handed. > > OK... Sorry for that. > >> I haven't >> scrutinized the code here so

Re: [HACKERS] Re: [COMMITTERS] pgsql: Change the way that LWLocks for extensions are allocated.

2016-11-02 Thread Ashutosh Sharma
Hi, I have started with the review for this patch and would like to share some of my initial review comments that requires author's attention. 1) I am getting some trailing whitespace errors when trying to apply this patch using git apply command. Following are the error messages i am getting.

Re: [HACKERS] WAL consistency check facility

2016-11-02 Thread Michael Paquier
On Wed, Nov 2, 2016 at 4:41 PM, Kuntal Ghosh wrote: > On Wed, Nov 2, 2016 at 10:23 AM, Michael Paquier > wrote: >> On Tue, Nov 1, 2016 at 10:31 PM, Robert Haas wrote: >>> IMHO, your rewrite of this patch was a bit

Re: [HACKERS] Patch to implement pg_current_logfile() function

2016-11-02 Thread Gilles Darold
Le 02/11/2016 à 03:51, Karl O. Pinc a écrit : > On Mon, 31 Oct 2016 09:26:27 +0100 > Gilles Darold wrote: > >> Le 30/10/2016 à 08:04, Karl O. Pinc a écrit : >> Attached patch v11 include your patch. >> >>> I have some questions about logfile_writename(): >>> >>> Why

Re: [HACKERS] WAL consistency check facility

2016-11-02 Thread Kuntal Ghosh
On Wed, Nov 2, 2016 at 1:34 PM, Michael Paquier wrote: > Hm... Right. That was broken. And actually, while the record-level > flag is useful so as you don't need to rely on checking > wal_consistency when doing WAL redo, the block-level flag is useful to > make a