Re: [HACKERS] Selective logical replication

2015-11-20 Thread Craig Ringer
On 20 November 2015 at 22:03, Craig Ringer wrote: > On 19 November 2015 at 16:48, konstantin knizhnik < > k.knizh...@postgrespro.ru> wrote: > >> Hi, >> >> I want to use logical replication for implementing multimaster (so all >> nodes are both sending and receiving

Re: [HACKERS] Foreign join pushdown vs EvalPlanQual

2015-11-20 Thread Kouhei Kaigai
> On 2015/11/19 12:32, Robert Haas wrote: > > On Tue, Nov 17, 2015 at 8:47 PM, Kouhei Kaigai wrote: > >> The attached patch is the portion cut from the previous EPQ recheck > >> patch. > > > Thanks, committed. > > Thanks, Robert and KaiGai-san. > > Sorry, I'm a bit late

Re: [HACKERS] Selective logical replication

2015-11-20 Thread Craig Ringer
On 19 November 2015 at 16:48, konstantin knizhnik wrote: > Hi, > > I want to use logical replication for implementing multimaster (so all > nodes are both sending and receiving changes). > Like http://bdr-project.org/ ? > But there is one "stupid" problem: how to

Re: [HACKERS] [DESIGN] ParallelAppend

2015-11-20 Thread Robert Haas
On Fri, Nov 20, 2015 at 12:45 AM, Amit Kapila wrote: > Okay, but I think that's not what I am talking about. I am talking about > below code in cost_seqscan: > > - if (nworkers > 0) > > - run_cost = run_cost / (nworkers + 0.5); > > + if (path->parallel_degree > 0) > > +

Re: [HACKERS] Foreign join pushdown vs EvalPlanQual

2015-11-20 Thread Etsuro Fujita
On 2015/11/19 12:32, Robert Haas wrote: On Tue, Nov 17, 2015 at 8:47 PM, Kouhei Kaigai wrote: The attached patch is the portion cut from the previous EPQ recheck patch. Thanks, committed. Thanks, Robert and KaiGai-san. Sorry, I'm a bit late to the party. Here are

Re: [HACKERS] [PATCH] Refactoring of LWLock tranches

2015-11-20 Thread Ildus Kurbangaliev
On Thu, 19 Nov 2015 11:09:38 -0500 Robert Haas wrote: > On Thu, Nov 19, 2015 at 9:04 AM, Ildus Kurbangaliev > wrote: > > The moving base tranches to shared memory has been discussed many > > times. The point is using them later in

Re: [HACKERS] Declarative partitioning

2015-11-20 Thread Alvaro Herrera
Amit Langote wrote: > On Fri, Nov 20, 2015 at 7:20 PM, Simon Riggs wrote: > > Drop it?? I think he means "in this initial patch", right Amit L ? > > Yes, there was some notion of multi-level partitioning in the earlier > patch but I removed it from the version I posted on

Re: [HACKERS] Declarative partitioning

2015-11-20 Thread Simon Riggs
On 20 November 2015 at 09:18, Amit Langote wrote: > On 2015/11/06 1:29, Robert Haas wrote: > > On Fri, Oct 30, 2015 at 6:08 AM, Amit Langote > > wrote: > >> The DDL and catalogs part are not much different from what I had last > >>

Re: [HACKERS] Declarative partitioning

2015-11-20 Thread Amit Langote
On Fri, Nov 20, 2015 at 7:20 PM, Simon Riggs wrote: > On 20 November 2015 at 09:18, Amit Langote > wrote: >> >> On 2015/11/06 1:29, Robert Haas wrote: >> > On Fri, Oct 30, 2015 at 6:08 AM, Amit Langote >> >

Re: [HACKERS] [Proposal] Table partition + join pushdown

2015-11-20 Thread Taiki Kondo
Hello, KaiGai-san. Thank you for your reply, and sorry for late response. I created v3 patch for this feature, and v1 patch for regression tests. Please find attached. Reply for your comments is below. > Overall comments > > * I think the enhancement in copyfuncs.c shall be in

Re: [HACKERS] Getting sorted data from foreign server for merge join

2015-11-20 Thread Ashutosh Bapat
On Thu, Nov 19, 2015 at 7:30 AM, Robert Haas wrote: > On Tue, Nov 17, 2015 at 8:33 AM, Ashutosh Bapat > wrote: > >> Although I'm usually on the side of marking things as extern whenever > >> we find it convenient, I'm nervous about doing

Re: [HACKERS] [BUGS] BUG #13779: Inherited check constraint becomes non-inherited when related column is changed

2015-11-20 Thread Tom Lane
jan.dirk.zijls...@redwood.com writes: > [ ALTER COLUMN TYPE leaves inherited constraints in the wrong state ] Yeah. After perusing this I've become convinced that ALTER TABLE's approach to rebuilding check constraints is fundamentally misguided. Rather than using ALTER TABLE ONLY to reconstruct

Re: [HACKERS] [COMMITTERS] pgsql: Add pg_audit, an auditing extension

2015-11-20 Thread David Steele
Hi Thom, On 11/18/15 8:54 AM, Thom Brown wrote: On 10 June 2015 at 14:41, Noah Misch wrote: On Tue, Jun 09, 2015 at 03:54:59PM -0400, David Steele wrote: I've certainly had quite the experience as a first-time contributor working on this patch. Perhaps I bit off more than

Re: [HACKERS] Parallel Seq Scan

2015-11-20 Thread Robert Haas
On Thu, Nov 19, 2015 at 11:59 PM, Amit Kapila wrote: > Isn't it better to destroy the memory for readers array as that gets > allocated > even if there are no workers available for execution? > > Attached patch fixes the issue by just destroying readers array. Well, then

Re: [HACKERS] Additional role attributes && superuser review

2015-11-20 Thread Stephen Frost
* Michael Paquier (michael.paqu...@gmail.com) wrote: > On Thu, Nov 19, 2015 at 7:10 AM, Stephen Frost wrote: > > * Michael Paquier (michael.paqu...@gmail.com) wrote: > >> It seems weird to not have a dedicated role for pg_switch_xlog. > > > > I didn't add a pg_switch_xlog default role in this

Re: [HACKERS] [PROPOSAL] VACUUM Progress Checker.

2015-11-20 Thread Robert Haas
On Thu, Nov 19, 2015 at 2:18 AM, Amit Langote wrote: > As someone pointed out upthread, the final heap truncate phase can take > arbitrarily long and is outside the scope of lazy_scan_heap() to > instrument. Perhaps a bool, say, waiting_heap_trunc could be reported

Re: [HACKERS] GIN pending list clean up exposure to SQL

2015-11-20 Thread Jaime Casanova
On 19 November 2015 at 14:57, Jaime Casanova wrote: > On 19 November 2015 at 14:47, Jaime Casanova > wrote: >> On 19 November 2015 at 14:18, Alvaro Herrera >> wrote: >>> Alvaro Herrera wrote: Jeff

Re: [HACKERS] Using quicksort for every external sort run

2015-11-20 Thread Robert Haas
On Thu, Nov 19, 2015 at 5:42 PM, Peter Geoghegan wrote: > I would like more opinions on the multipass_warning message. I can > write a patch that creates a new system view, detailing how sort were > completed, if there is demand. I think a warning message is a terrible idea, and

Re: CustomScan in a larger structure (RE: [HACKERS] CustomScan support on readfuncs.c)

2015-11-20 Thread Robert Haas
On Thu, Nov 19, 2015 at 10:11 PM, Kouhei Kaigai wrote: > The above two points are for the case if and when extension want to use > variable length fields for its private fields. > So, nodeAlloc() callback is not a perfect answer for the use case because > length of the

Re: [HACKERS] Using quicksort for every external sort run

2015-11-20 Thread Robert Haas
On Thu, Nov 19, 2015 at 5:53 PM, Peter Geoghegan wrote: > I'll now talk about my patch series in general -- the actual > consequences of not avoiding a single pass merge phase when the master > branch would have done so. That's what I was asking about. It seemed to me that you

Re: [HACKERS] Freeze avoidance of very large table.

2015-11-20 Thread Jeff Janes
On Thu, Nov 19, 2015 at 6:44 AM, Masahiko Sawada wrote: > On Thu, Nov 19, 2015 at 5:54 AM, Jeff Janes wrote: >> On Wed, Nov 18, 2015 at 11:18 AM, Jeff Janes wrote: >>> >>> I get an error when running pg_upgrade from 9.4 to

Re: [HACKERS] COPY (INSERT/UPDATE/DELETE .. RETURNING ..)

2015-11-20 Thread Marko Tiikkaja
On 11/19/15 7:39 PM, Michael Paquier wrote: On Thu, Nov 19, 2015 at 9:22 PM, Marko Tiikkaja wrote: Of course, something might break if we added a new statement type which supported RETURNING, but I'm really not worried about that. I'm not dead set against adding some

Re: [HACKERS] Declarative partitioning

2015-11-20 Thread Amit Langote
On 2015/11/06 1:29, Robert Haas wrote: > On Fri, Oct 30, 2015 at 6:08 AM, Amit Langote > wrote: >> The DDL and catalogs part are not much different from what I had last >> described though I took a few steps to simplify things. I dropped the >> multi-level

Re: [HACKERS] Using quicksort for every external sort run

2015-11-20 Thread Peter Geoghegan
On Fri, Nov 20, 2015 at 12:50 PM, Robert Haas wrote: > On Thu, Nov 19, 2015 at 5:42 PM, Peter Geoghegan wrote: >> I would like more opinions on the multipass_warning message. I can >> write a patch that creates a new system view, detailing how sort were >>

Re: CustomScan in a larger structure (RE: [HACKERS] CustomScan support on readfuncs.c)

2015-11-20 Thread Kouhei Kaigai
> On Thu, Nov 19, 2015 at 10:11 PM, Kouhei Kaigai wrote: > > The above two points are for the case if and when extension want to use > > variable length fields for its private fields. > > So, nodeAlloc() callback is not a perfect answer for the use case because > > length of

Re: [HACKERS] Using quicksort for every external sort run

2015-11-20 Thread Peter Geoghegan
On Fri, Nov 20, 2015 at 12:52 PM, Robert Haas wrote: > That's what I was asking about. It seemed to me that you were saying > we could ignore those cases, which doesn't seem to me to be true. I've been around for long enough to know that there are very few cases that can

Re: [HACKERS] RLS open items are vague and unactionable

2015-11-20 Thread Noah Misch
On Mon, Sep 28, 2015 at 03:03:51PM -0400, Stephen Frost wrote: > If SELECT rights are required then apply the SELECT policies, even if > the actual command is an UPDATE or DELETE. This covers the RETURNING > case which was discussed previously, so we don't need the explicit check > for that, and

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-11-20 Thread Marko Tiikkaja
On 2015-11-21 06:02, I wrote: Here's a patch implementing this under the name num_nulls(). For January's CF, of course. I forgot to update the some references in the documentation. Fixed in v3, attached. .m *** a/doc/src/sgml/func.sgml --- b/doc/src/sgml/func.sgml *** ***

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-11-20 Thread Marko Tiikkaja
On 2015-11-21 06:06, Tom Lane wrote: Marko Tiikkaja writes: Here's a patch implementing this under the name num_nulls(). For January's CF, of course. What's this do that "count(*) - count(x)" doesn't? This is sort of a lateral version of count(x); the input is a list of

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-11-20 Thread Tom Lane
Marko Tiikkaja writes: > Here's a patch implementing this under the name num_nulls(). For > January's CF, of course. What's this do that "count(*) - count(x)" doesn't? regards, tom lane -- Sent via pgsql-hackers mailing list

[HACKERS] CreateFunction Statement

2015-11-20 Thread Praveen M
Hi All, I am trying to get the schema name of the create function call from the parse tree. When I look at the structure of the CreateFunctionStmt , I do not see the schemaname information . Can you please help me to understand how to extract the schema name for the function. typedef struct

Re: [HACKERS] [PROPOSAL] VACUUM Progress Checker.

2015-11-20 Thread Jim Nasby
On 11/19/15 7:29 PM, Amit Langote wrote: Another option is to provide the means for the index scan routines to >report their progress. Maybe every index AM won't use it, but it'd >certainly be a lot better than staring at a long_running boolean. The boolean would be a workaround for sure. I'm

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-11-20 Thread Jim Nasby
On 11/20/15 11:12 PM, Marko Tiikkaja wrote: On 2015-11-21 06:02, I wrote: Here's a patch implementing this under the name num_nulls(). For January's CF, of course. I forgot to update the some references in the documentation. Fixed in v3, attached. I thought there was going to be a

Re: [HACKERS] GIN pending list clean up exposure to SQL

2015-11-20 Thread Jim Nasby
On 11/19/15 10:47 AM, Jaime Casanova wrote: - only superusers? I would think the owner of the table (index?) should also be able to run this. -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and PostgreSQL Data in Trouble? Get it in

Re: [HACKERS] CreateFunction Statement

2015-11-20 Thread Pavel Stehule
Hi 2015-11-21 7:09 GMT+01:00 Praveen M : > Hi All, > > I am trying to get the schema name of the create function call from the > parse tree. When I look at the structure of the CreateFunctionStmt , I do > not see the schemaname information . Can you please help me to understand

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-11-20 Thread Marko Tiikkaja
Hello, Here's a patch implementing this under the name num_nulls(). For January's CF, of course. .m *** a/doc/src/sgml/func.sgml --- b/doc/src/sgml/func.sgml *** *** 182,188 !Comparison Operators comparison --- 182,188 !

Re: [HACKERS] count_nulls(VARIADIC "any")

2015-11-20 Thread Marko Tiikkaja
On 2015-11-21 06:52, Jim Nasby wrote: On 11/20/15 11:12 PM, Marko Tiikkaja wrote: On 2015-11-21 06:02, I wrote: Here's a patch implementing this under the name num_nulls(). For January's CF, of course. I forgot to update the some references in the documentation. Fixed in v3, attached. I

[HACKERS] custom function for converting human readable sizes to bytes

2015-11-20 Thread Pavel Stehule
Hi I have to write some filters, and filtering by size is "unfriendly" due calculation in bytes. I propose inversion function to pg_size_pretty function - like pg_human_size. Usage: SELECT * FROM pg_class WHERE pg_table_size(oid) > pg_human_size('2GB'); Ideas, comments? Regards Pavel

Re: [HACKERS] onlyvalue aggregate (was: First Aggregate Funtion?)

2015-11-20 Thread Marko Tiikkaja
Hi Dean, Here's v2 of the patch. How's this look? .m *** a/doc/src/sgml/func.sgml --- b/doc/src/sgml/func.sgml *** *** 12635,12640 NULL baz(3 rows) --- 12635,12660 + single_value + + + single_value(expression) +