Re: [HACKERS] WARNING: relcache reference leak: relation "p1" not closed

2017-03-06 Thread Amit Langote
On 2017/03/07 7:28, Tom Lane wrote: > Kevin Grittner writes: >> With e434ad39ae7316bcf35fd578dd34ad7e1ff3c25f I did a `make world`, >> `make install-world`, a fresh default initdb, a start with default >> config, `make installcheck`, connected to the regression database >> with

Re: [HACKERS] WARNING: relcache reference leak: relation "p1" not closed

2017-03-06 Thread Michael Paquier
On Tue, Mar 7, 2017 at 10:37 AM, Amit Langote wrote: > On 2017/03/07 7:28, Tom Lane wrote: >> Kevin Grittner writes: >>> With e434ad39ae7316bcf35fd578dd34ad7e1ff3c25f I did a `make world`, >>> `make install-world`, a fresh default initdb, a start

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-06 Thread Amit Langote
On 2017/03/06 17:22, Michael Paquier wrote: > On Mon, Mar 6, 2017 at 4:18 PM, Amit Langote > wrote: >> About autovacuum_* parameters - we currently don't handle partitioned >> tables in autovacuum.c, because no statistics are reported for them. That >> is,

Re: [HACKERS] Small fix to postgresql.conf.sample's comment on max_parallel_workers

2017-03-06 Thread Amit Kapila
On Tue, Mar 7, 2017 at 6:39 AM, David Rowley wrote: > While scanning over postgresql.conf I happened to notice something > that didn't ring quite true about max_parallel_workers. The comment > confuses worker_processes with parallel workers. > +1. How about

Re: [HACKERS] WARNING: relcache reference leak: relation "p1" not closed

2017-03-06 Thread Tom Lane
Amit Langote writes: > Also, I found out that alter_table.sql mistakenly forgot to drop > partitioned table "p1". Patch 0002 takes care of that. While that might or might not have been intentional, I think it's an astoundingly bad idea to not leave any partitioned

Re: [HACKERS] Need a builtin way to run all tests faster manner

2017-03-06 Thread Andres Freund
On 2017-03-06 19:45:27 -0500, Tom Lane wrote: > Stephen Frost writes: > > * Andres Freund (and...@anarazel.de) wrote: > >> I'm not quite sure what the best way to attack this is, but I think we > >> need to do something. > > > I tend to agree with this, though I haven't got

Re: [HACKERS] Declarative partitioning optimization for large amount of partitions

2017-03-06 Thread Amit Langote
Hi Aleksander, On 2017/03/07 0:22, Aleksander Alekseev wrote: > Hello. > > OK, here is a patch. > > Benchmark, before: > > ``` > number of transactions actually processed: 1823 > latency average = 1153.495 ms > latency stddev = 154.366 ms > tps = 6.061104 (including connections establishing) >

Re: [HACKERS] Restricting maximum keep segments by repslots

2017-03-06 Thread Craig Ringer
On 28 February 2017 at 12:27, Petr Jelinek wrote: >> This patch adds a GUC to put a limit to the number of segments >> that replication slots can keep. Hitting the limit during >> checkpoint shows a warining and the segments older than the limit >> are removed. >>

Re: [HACKERS] wait events for disk I/O

2017-03-06 Thread Amit Kapila
On Tue, Mar 7, 2017 at 5:27 AM, Robert Haas wrote: > On Mon, Mar 6, 2017 at 3:27 AM, Rushabh Lathia > wrote: >> Yes, I thought of adding wait event only for the sync but then recording the >> wait event for both write and sync. I understand that

Re: [HACKERS] Parallel seq. plan is not coming against inheritance or partition table

2017-03-06 Thread Amit Kapila
On Tue, Mar 7, 2017 at 3:24 AM, Robert Haas wrote: > On Sun, Mar 5, 2017 at 9:41 PM, Amit Kapila wrote: >>> RCA: >>> >>> From "Replace min_parallel_relation_size with two new GUCs" commit >>> onwards, we are not assigning parallel workers for

Re: [HACKERS] Foreign Join pushdowns not working properly for outer joins

2017-03-06 Thread Etsuro Fujita
On 2017/03/06 21:22, Ashutosh Bapat wrote: On Mon, Mar 6, 2017 at 1:29 PM, David Rowley wrote: On 6 March 2017 at 18:51, Etsuro Fujita wrote: On 2017/03/06 11:05, David Rowley wrote: I looked over yours and was surprised to see: +

Re: [HACKERS] amcheck (B-Tree integrity checking tool)

2017-03-06 Thread Peter Geoghegan
On Mon, Mar 6, 2017 at 3:57 PM, Andres Freund wrote: > I'm ok with not immediately doing so, but I think Peter's design isn't > in line with achieving something like this. I would be okay with doing this if we had a grab-bag of expensive checks, that all pretty much require

Re: [HACKERS] WARNING: relcache reference leak: relation "p1" not closed

2017-03-06 Thread Amit Langote
On 2017/03/07 10:49, Michael Paquier wrote: > On Tue, Mar 7, 2017 at 10:37 AM, Amit Langote > wrote: >> On 2017/03/07 7:28, Tom Lane wrote: >>> Kevin Grittner writes: With e434ad39ae7316bcf35fd578dd34ad7e1ff3c25f I did a `make world`,

Re: [HACKERS] increasing the default WAL segment size

2017-03-06 Thread Ashutosh Sharma
Hi, I took a look at this patch. Overall, the patch looks good to me. However, there are some review comments that I would like to share, 1. I think the macro 'PATH_MAX' used in pg_waldump.c file is specific to Linux. It needs to be changed to some constant value or may be MAXPGPATH inorder to

Re: [HACKERS] dump a comment of a TSDictionary

2017-03-06 Thread Tom Lane
Giuseppe Broccolo writes: > I've seen that pg_dump execute the dump of an eventual comment of a > TSDictionary without specifying the namespace where it is defined: > https://github.com/postgres/postgres/blob/master/src/bin/pg_dump/pg_dump.c#L13542 Yup, this is

Re: [HACKERS] Parallel seq. plan is not coming against inheritance or partition table

2017-03-06 Thread Ashutosh Sharma
> I also think that commit didn't intend to change the behavior, > however, the point is how sensible is it to keep such behavior after > Parallel Append. I am not sure if this is the right time to consider > it or shall we wait till Parallel Append is committed. > >> I think the problem here is

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

2017-03-06 Thread Michael Paquier
On Tue, Mar 7, 2017 at 3:21 AM, Robert Haas wrote: > On Sat, Mar 4, 2017 at 10:32 AM, Tom Lane wrote: >> Without having actually looked at this patch, I would say that if it added >> a direct call of fopen() to backend-side code, that was already the

Re: [HACKERS] Need a builtin way to run all tests faster manner

2017-03-06 Thread Tom Lane
Stephen Frost writes: > * Andres Freund (and...@anarazel.de) wrote: >> I'm not quite sure what the best way to attack this is, but I think we >> need to do something. > I tend to agree with this, though I haven't got any great answers, > unfortunately. I don't want to reduce

Re: [HACKERS] Patch to improve performance of replay of AccessExclusiveLock

2017-03-06 Thread David Rowley
On 2 March 2017 at 16:06, Amit Kapila wrote: > On Wed, Mar 1, 2017 at 5:32 PM, David Rowley > wrote: >> Hackers, >> >> I've attached a small patch which aims to improve the performance of >> AccessExclusiveLock when there are many

[HACKERS] on_dsm_detach() callback and parallel tuplesort BufFile resource management

2017-03-06 Thread Peter Geoghegan
Recap = A design goal of parallel tuplesort is that the parallel case be as close to possible as the serial case is already. Very little new code is needed in tuplesort.c and logtape.c, most of which is about using a new lower-level facility which is very well encapsulated. And, even

Re: [HACKERS] Small fix to postgresql.conf.sample's comment on max_parallel_workers

2017-03-06 Thread David Rowley
On 7 March 2017 at 15:21, Amit Kapila wrote: > +1. How about changing the description of > max_parallel_workers_per_gather to "taken from max_worker_processes, > limited by max_parallel_workers"? Thanks for looking. Seems more accurate to say that it's "taken from

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-06 Thread Ashutosh Bapat
I see that all the changes by Amit and myself to what was earlier 0003 patch are now part of 0002 patch. The patch looks ready for committer. Some comments about 0003 patch. CREATE TABLE syntax seems to allow specifying reloptions for a partitioned table. But extractRelOptions() and

Re: [HACKERS] Statement-level rollback

2017-03-06 Thread Tsunakawa, Takayuki
From: pgsql-hackers-ow...@postgresql.org > [mailto:pgsql-hackers-ow...@postgresql.org] On Behalf Of Robert Haas > >> Can you provide some references on how other systems provide this feature? > > > > Oracle doesn't. > > Really? Sorry, my sentence was misleading. I meant by "Oracle/MySQL doesn't"

Re: [HACKERS] Enabling replication connections by default in pg_hba.conf

2017-03-06 Thread Michael Paquier
On Tue, Mar 7, 2017 at 5:03 AM, Peter Eisentraut wrote: > On 3/3/17 20:30, Michael Paquier wrote: >> Yeah, it looks sensible to me to keep "replication" for physical >> replication, and switch logical replication checks to match a database >> name in hba

[HACKERS] Small fix to postgresql.conf.sample's comment on max_parallel_workers

2017-03-06 Thread David Rowley
While scanning over postgresql.conf I happened to notice something that didn't ring quite true about max_parallel_workers. The comment confuses worker_processes with parallel workers. The attached aims to put this right. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL

Re: [HACKERS] Report the number of skipped frozen pages by manual VACUUM

2017-03-06 Thread Masahiko Sawada
On Mon, Mar 6, 2017 at 12:12 PM, Yugo Nagata wrote: > Hi, > > I think this is good since the information is useful and it is > a little change. Thank you for reviewing this patch! > > One thing I'm bothered is that even when the number of frozen page is > one, it will say

Re: [HACKERS] Logical replication existing data copy

2017-03-06 Thread Petr Jelinek
On 06/03/17 23:40, Erik Rijkers wrote: > On 2017-03-06 16:10, Erik Rijkers wrote: >> On 2017-03-06 11:27, Petr Jelinek wrote: >>> Hi, >>> >>> updated and rebased version of the patch attached. >>> >> >> I compiled with /only/ this one latest patch: >>

Re: [HACKERS] adding an immutable variant of to_date

2017-03-06 Thread Andreas Karlsson
On 03/03/2017 10:41 PM, Sven R. Kunze wrote: What do you think? I have some thoughts: 1) I do not think we currently allow setting the locale like this anywhere, so this will introduce a new concept to PostgreSQL. And you will probably need to add support for caching per locale. 2) As far

Re: [HACKERS] Re: check failure with -DRELCACHE_FORCE_RELEASE -DCLOBBER_FREED_MEMORY

2017-03-06 Thread Andrew Dunstan
On 03/06/2017 05:14 PM, Tom Lane wrote: > I wrote: >> I fixed that, and the basic regression tests no longer crash outright with >> these settings, but I do see half a dozen errors that all seem to be in >> RLS-related tests. > Those turned out to all be the same bug in DoCopy. "make

Re: [HACKERS] Foreign Join pushdowns not working properly for outer joins

2017-03-06 Thread Ashutosh Bapat
On Tue, Mar 7, 2017 at 9:33 AM, Etsuro Fujita wrote: > On 2017/03/06 21:22, Ashutosh Bapat wrote: >> >> On Mon, Mar 6, 2017 at 1:29 PM, David Rowley >> wrote: >>> >>> On 6 March 2017 at 18:51, Etsuro Fujita

Re: [HACKERS] allow referring to functions without arguments when unique

2017-03-06 Thread Michael Paquier
On Fri, Mar 3, 2017 at 4:12 PM, Michael Paquier wrote: > On Wed, Mar 1, 2017 at 11:50 AM, Peter Eisentraut > wrote: >> This is the "grand finale" that goes on top of the "DROP FUNCTION of >> multiple functions" patch set. The purpose

Re: [HACKERS] ANALYZE command progress checker

2017-03-06 Thread Haribabu Kommi
On Tue, Mar 7, 2017 at 5:01 PM, Michael Paquier wrote: > > @@ -496,7 +499,6 @@ do_analyze_rel(Relation onerel, int options, > VacuumParams *params, > numrows = (*acquirefunc) (onerel, elevel, > rows, targrows, >

[HACKERS] logical replication apply to run with sync commit off by default

2017-03-06 Thread Petr Jelinek
Hi, there has been discussion at the logical replication initial copy thread [1] about making apply work with sync commit off by default for performance reasons and adding option to change that per subscription. Here I propose patch to implement this - it adds boolean column subssynccommit to

Re: [HACKERS] Parallel seq. plan is not coming against inheritance or partition table

2017-03-06 Thread Amit Kapila
On Tue, Mar 7, 2017 at 10:22 AM, Ashutosh Sharma wrote: >> I also think that commit didn't intend to change the behavior, >> however, the point is how sensible is it to keep such behavior after >> Parallel Append. I am not sure if this is the right time to consider >> it

Re: [HACKERS] Parallel seq. plan is not coming against inheritance or partition table

2017-03-06 Thread Ashutosh Sharma
On Tue, Mar 7, 2017 at 11:18 AM, Amit Kapila wrote: > On Tue, Mar 7, 2017 at 10:22 AM, Ashutosh Sharma > wrote: >>> I also think that commit didn't intend to change the behavior, >>> however, the point is how sensible is it to keep such behavior

Re: [HACKERS] contrib modules and relkind check

2017-03-06 Thread Amit Langote
Sorry about the absence on this thread. On 2017/02/14 15:30, Michael Paquier wrote: > On Tue, Feb 14, 2017 at 3:18 PM, Amit Langote wrote: >> >> Added more tests in pgstattuple and the new ones for pg_visibility, >> although I may have overdone the latter. > > A bonus idea is also to add tests

Re: [HACKERS] WARNING: relcache reference leak: relation "p1" not closed

2017-03-06 Thread Amit Langote
On 2017/03/07 14:04, Tom Lane wrote: > Amit Langote writes: >> Also, I found out that alter_table.sql mistakenly forgot to drop >> partitioned table "p1". Patch 0002 takes care of that. > > While that might or might not have been intentional, I think it's an >

Re: [HACKERS] ANALYZE command progress checker

2017-03-06 Thread Michael Paquier
On Mon, Mar 6, 2017 at 3:58 PM, Andres Freund wrote: > On 2017-03-03 15:33:15 -0500, David Steele wrote: >> On 3/1/17 1:25 PM, Andres Freund wrote: >> > On 2017-03-01 10:20:41 -0800, David Fetter wrote: >> >> On Wed, Mar 01, 2017 at 09:45:40AM -0500, Peter Eisentraut wrote: >>

Re: [HACKERS] [NOVICE] opr_charset rule in gram.y

2017-03-06 Thread Tom Lane
Neha Khatri writes: > I was going through the grammer rule for Character types in gram.y and > found an optional sub rule in is "opt_charset" This question seems quite off-topic for pgsql-novice, so I've redirected it to pgsql-hackers. > CharacterWithLength: character

Re: [HACKERS] GUC for cleanup indexes threshold.

2017-03-06 Thread Masahiko Sawada
On Sat, Mar 4, 2017 at 4:37 AM, Peter Geoghegan wrote: > On Fri, Mar 3, 2017 at 8:13 AM, Masahiko Sawada wrote: >> Thank you for clarification. Let me check my understanding. IIUC, >> skipping second index vacuum path (lazy_cleanup_index) can not be >> cause

Re: [HACKERS] ANALYZE command progress checker

2017-03-06 Thread Amit Langote
Hi Vinayak, On 2017/02/28 18:24, vinayak wrote: > The attached patch reports the different phases of analyze command. > Added this patch to CF 2017-03. In the updated monitoring.sgml: + + computing heap stats + + VACUUM is currently computing heap stats. + + + +

[HACKERS] pg_dump segfaults with publication

2017-03-06 Thread Amit Langote
Hi, pg_dump segfaults if there are more than one DO_PUBLICATION_REL objects to dump. create table foo (a int); create publication foo_pub; alter publication foo_pub add table foo; $ pg_dump create table bar (a int); alter publication foo_pub add table bar; $ pg_dump -s Segmentation fault

Re: [HACKERS] Radix tree for character conversion

2017-03-06 Thread Kyotaro HORIGUCHI
Hello, At Fri, 3 Mar 2017 12:53:04 +0900, Michael Paquier wrote in > On Thu, Mar 2, 2017 at 2:20 PM, Kyotaro HORIGUCHI > wrote: > > 5) Just remove plain map files

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-06 Thread Ashutosh Bapat
On Mon, Mar 6, 2017 at 1:26 PM, Amit Langote wrote: > On 2017/03/06 16:49, Ashutosh Bapat wrote: >> On Mon, Mar 6, 2017 at 12:48 PM, Amit Langote wrote: >>> On 2017/03/06 15:41, Michael Paquier wrote: This comment is not completely correct. Children can be temp

Re: [HACKERS] [BUG FIX] Removing NamedLWLockTrancheArray

2017-03-06 Thread Kyotaro HORIGUCHI
Ok, I think I understand the complete picture. At Mon, 06 Mar 2017 15:58:56 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20170306.155856.198084190.horiguchi.kyot...@lab.ntt.co.jp> > > I can guess two ways to fix this. One is change the definition of

Re: [HACKERS] UPDATE of partition key

2017-03-06 Thread Amit Langote
Hi, On 2017/03/02 15:23, Amit Khandekar wrote: > On 23 February 2017 at 16:02, Amit Langote > wrote: >> >>> 2. In the patch, as part of the row movement, ExecDelete() is called >>> followed by ExecInsert(). This is done that way, because we want to >>> have the ROW

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-06 Thread Michael Paquier
On Mon, Mar 6, 2017 at 4:18 PM, Amit Langote wrote: > About autovacuum_* parameters - we currently don't handle partitioned > tables in autovacuum.c, because no statistics are reported for them. That > is, relation_needs_vacanalyze() will never return true for

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-06 Thread Ashutosh Bapat
> > We can leave it for the committer to decide, maybe. Committers often > rewrite surrounding comments to improve wording, correcting factual > errors, etc. > Sure. -- Best Wishes, Ashutosh Bapat EnterpriseDB Corporation The Postgres Database Company -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Logical replication and inheritance

2017-03-06 Thread Amit Langote
On 2017/03/04 4:24, Peter Eisentraut wrote: > On 2/27/17 01:57, Amit Langote wrote: >> I see that if the table is a inheritance parent, and ONLY is not >> specified, the child tables are also added to the publication. > >> If the child table is later removed from the inheritance hierarchy, it >>

Re: [HACKERS] Print correct startup cost for the group aggregate.

2017-03-06 Thread Rushabh Lathia
Thanks Ashutosh & Robert for the explanation. On Mon, Mar 6, 2017 at 10:02 AM, Ashutosh Bapat < ashutosh.ba...@enterprisedb.com> wrote: > On Sat, Mar 4, 2017 at 2:50 PM, Robert Haas wrote: > > On Thu, Mar 2, 2017 at 6:48 PM, Ashutosh Bapat > >

Re: [HACKERS] Restricting maximum keep segments by repslots

2017-03-06 Thread Kyotaro HORIGUCHI
Thank you for the comment. At Fri, 3 Mar 2017 14:47:20 -0500, Peter Eisentraut wrote in > On 3/1/17 19:54, Kyotaro HORIGUCHI wrote: > >> Please measure it in size, not in number of segments. > > It was

Re: [HACKERS] dropping partitioned tables without CASCADE

2017-03-06 Thread Ashutosh Bapat
On Mon, Mar 6, 2017 at 11:12 AM, Ashutosh Bapat wrote: > On Mon, Mar 6, 2017 at 11:05 AM, Simon Riggs wrote: >> On 6 March 2017 at 05:29, Ashutosh Bapat >> wrote: >> >>> Just to confirm, you want the output

Re: [HACKERS] ANALYZE command progress checker

2017-03-06 Thread vinayak
On 2017/03/06 17:02, Amit Langote wrote: Hi Vinayak, On 2017/02/28 18:24, vinayak wrote: The attached patch reports the different phases of analyze command. Added this patch to CF 2017-03. In the updated monitoring.sgml: + + computing heap stats + + VACUUM is currently

Re: [HACKERS] Partitioned tables and relfilenode

2017-03-06 Thread Amit Langote
On 2017/03/06 17:01, Ashutosh Bapat wrote: > On Mon, Mar 6, 2017 at 1:26 PM, Amit Langote > wrote: >> On 2017/03/06 16:49, Ashutosh Bapat wrote: >>> On Mon, Mar 6, 2017 at 12:48 PM, Amit Langote wrote: On 2017/03/06 15:41, Michael Paquier wrote: > This

Re: [HACKERS] wait events for disk I/O

2017-03-06 Thread Rushabh Lathia
On Sat, Mar 4, 2017 at 7:53 PM, Amit Kapila wrote: > On Mon, Feb 20, 2017 at 4:04 PM, Rushabh Lathia > wrote: > > > > My colleague Rahila reported compilation issue with > > the patch. Issue was only coming with we do the clean > > build on the

Re: [HACKERS] Change in "policy" on dump ordering?

2017-03-06 Thread Michael Banck
Hi, On Sat, Mar 04, 2017 at 02:49:36PM -0500, Peter Eisentraut wrote: > On 3/1/17 08:36, Peter Eisentraut wrote: > > On 2/22/17 18:24, Jim Nasby wrote: > >>> Yes, by that logic matview refresh should always be last. > >> > >> Patches for head attached. > >> > >> RLS was the first item added after

Re: [HACKERS] [BUG FIX] Removing NamedLWLockTrancheArray

2017-03-06 Thread Kyotaro HORIGUCHI
By the way, At Mon, 06 Mar 2017 17:07:55 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20170306.170755.68410634.horiguchi.kyot...@lab.ntt.co.jp> > Ok, I think I understand the complete picture. > > At Mon, 06 Mar 2017 15:58:56 +0900 (Tokyo Standard

Re: [HACKERS] Logical replication and inheritance

2017-03-06 Thread Amit Langote
On 2017/03/06 18:04, Amit Langote wrote: > One more option is for OpenTableList() called by CreatePublication() and > AlterPublicationTables() to not disregard inheritance, as if ONLY was > specified. Oops, meant to say: One more option is for OpenTableList to disregard inheritance... Thanks,

Re: [HACKERS] Print correct startup cost for the group aggregate.

2017-03-06 Thread Ashutosh Bapat
> > > I understood you reasoning of why startup_cost = input_startup_cost and not > input_total_cost for aggregation by sorting. But what I didn't understand is > how come higher startup cost for aggregation by sorting would force hash > aggregation to be chosen? I am not clear about this part.

Re: [HACKERS] Logical Replication and Character encoding

2017-03-06 Thread Kyotaro HORIGUCHI
At Fri, 3 Mar 2017 21:31:24 -0500, Peter Eisentraut wrote in <88397afa-a8ec-8d8a-1c94-94a4795a3...@2ndquadrant.com> > On 3/3/17 14:51, Petr Jelinek wrote: > > On 03/03/17 20:37, Peter Eisentraut wrote: > >> On 2/27/17 00:23, Kyotaro HORIGUCHI wrote: > >>> Yeah,

Re: [HACKERS] Logical Replication and Character encoding

2017-03-06 Thread Petr Jelinek
On 06/03/17 11:06, Kyotaro HORIGUCHI wrote: > At Fri, 3 Mar 2017 21:31:24 -0500, Peter Eisentraut > wrote in > <88397afa-a8ec-8d8a-1c94-94a4795a3...@2ndquadrant.com> >> On 3/3/17 14:51, Petr Jelinek wrote: >>> On 03/03/17 20:37, Peter Eisentraut wrote: On

<    1   2