Re: [HACKERS] Function array_agg(array)

2014-10-25 Thread Ali Akbar
2014-10-25 10:29 GMT+07:00 Ali Akbar the.ap...@gmail.com: I fixed small issue in regress tests and I enhanced tests for varlena types and null values. Thanks. it is about 15% faster than original implementation. 15% faster than array_agg(scalar)? I haven't verify the performance, but

Re: [HACKERS] Function array_agg(array)

2014-10-25 Thread Pavel Stehule
2014-10-25 8:19 GMT+02:00 Ali Akbar the.ap...@gmail.com: 2014-10-25 10:29 GMT+07:00 Ali Akbar the.ap...@gmail.com: I fixed small issue in regress tests and I enhanced tests for varlena types and null values. Thanks. it is about 15% faster than original implementation. 15% faster than

Re: [HACKERS] Function array_agg(array)

2014-10-25 Thread Pavel Stehule
2014-10-25 8:33 GMT+02:00 Pavel Stehule pavel.steh...@gmail.com: 2014-10-25 8:19 GMT+02:00 Ali Akbar the.ap...@gmail.com: 2014-10-25 10:29 GMT+07:00 Ali Akbar the.ap...@gmail.com: I fixed small issue in regress tests and I enhanced tests for varlena types and null values. Thanks. it

Re: [HACKERS] Function array_agg(array)

2014-10-25 Thread Ali Akbar
makeArrayResult1 - I have no better name now I found one next minor detail. you reuse a array_agg_transfn function. Inside is a message array_agg_transfn called in non-aggregate context. It is not correct for array_agg_anyarray_transfn Fixed. probably specification dim and lbs in

Re: [HACKERS] Function array_agg(array)

2014-10-25 Thread Pavel Stehule
2014-10-25 10:16 GMT+02:00 Ali Akbar the.ap...@gmail.com: makeArrayResult1 - I have no better name now I found one next minor detail. you reuse a array_agg_transfn function. Inside is a message array_agg_transfn called in non-aggregate context. It is not correct for

Re: [HACKERS] [PATCH] Support for Array ELEMENT Foreign Keys

2014-10-25 Thread Thom Brown
On 24 October 2012 18:17, Tom Lane t...@sss.pgh.pa.us wrote: Marco Nenciarini marco.nenciar...@2ndquadrant.it writes: Please find the attached refreshed patch (v2) which fixes the loose ends you found. Attached is a v3 patch that updates the syntax per discussion, uses what seems to me to

Re: [HACKERS] Function array_agg(array)

2014-10-25 Thread Ali Akbar
2014-10-25 15:43 GMT+07:00 Pavel Stehule pavel.steh...@gmail.com: 2014-10-25 10:16 GMT+02:00 Ali Akbar the.ap...@gmail.com: makeArrayResult1 - I have no better name now I found one next minor detail. you reuse a array_agg_transfn function. Inside is a message array_agg_transfn called

Re: [HACKERS] INSERT ... ON CONFLICT {UPDATE | IGNORE}

2014-10-25 Thread Alvaro Herrera
Peter Geoghegan wrote: On Fri, Oct 24, 2014 at 4:39 PM, Petr Jelinek p...@2ndquadrant.com wrote: Ugh, you want to auto-magically detect what value is behind the EXCLUDED based on how/where it's used in the UPDATE? That seems like quite a bad idea. That's *exactly* how DEFAULT works

Re: [HACKERS] pg_background (and more parallelism infrastructure patches)

2014-10-25 Thread Alvaro Herrera
Robert Haas wrote: On Fri, Oct 24, 2014 at 4:46 PM, Jim Nasby jim.na...@bluetreble.com wrote: On 10/24/14, 12:21 PM, Robert Haas wrote: - What should we call dsm_unkeep_mapping, if not that? Only option I can think of beyond unkeep would be dsm_(un)register_keep_mapping. Dunno that it's

Re: [HACKERS] Function array_agg(array)

2014-10-25 Thread Pavel Stehule
2014-10-25 12:20 GMT+02:00 Ali Akbar the.ap...@gmail.com: 2014-10-25 15:43 GMT+07:00 Pavel Stehule pavel.steh...@gmail.com: 2014-10-25 10:16 GMT+02:00 Ali Akbar the.ap...@gmail.com: makeArrayResult1 - I have no better name now I found one next minor detail. you reuse a

Re: [HACKERS] TODO : Allow parallel cores to be used by vacuumdb [ WIP ]

2014-10-25 Thread Amit Kapila
On Tue, Oct 7, 2014 at 11:10 AM, Dilip kumar dilip.ku...@huawei.com wrote: On 26 September 2014 12:24, Amit Kapila Wrote, I don't think this can handle cancel requests properly because you are just setting it in GetIdleSlot() what if the cancel request came during GetQueryResult() after

Re: [HACKERS] [PATCH] Support for Array ELEMENT Foreign Keys

2014-10-25 Thread Alvaro Herrera
Thom Brown wrote: On 24 October 2012 18:17, Tom Lane t...@sss.pgh.pa.us wrote: Marco Nenciarini marco.nenciar...@2ndquadrant.it writes: Please find the attached refreshed patch (v2) which fixes the loose ends you found. Attached is a v3 patch that updates the syntax per discussion,

Re: [HACKERS] [PATCH] Support for Array ELEMENT Foreign Keys

2014-10-25 Thread Alvaro Herrera
Alvaro Herrera wrote: Thom Brown wrote: Does anyone have any intention of resurrecting this at this stage? Not in this room. Do you? I should have added some more context so that people realizes that this room contains the 2ndQuadrant people involved in writing this patch. Also I wanted

Re: [HACKERS] Getting rid of accept incoming network connections prompts on OS X

2014-10-25 Thread Peter Eisentraut
On 10/24/14 10:27 AM, Tom Lane wrote: Some clients (eg JDBC) don't support Unix-socket connections AFAIK, so this seems like a rather restricted solution. While this is a valid point, they're actually working on fixing that. -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Getting rid of accept incoming network connections prompts on OS X

2014-10-25 Thread Peter Eisentraut
On 10/24/14 9:39 AM, Tom Lane wrote: Peter, Dave: maybe you have tweaked things to keep listen_addresses empty and rely only on Unix-socket connections? I can confirm that I do get the popup when starting an installed postmaster with the default settings. Given that this doesn't affect make

Re: [HACKERS] Function array_agg(array)

2014-10-25 Thread Ali Akbar
you can check it? We can test, how performance lost we get. As second benefit we can get numbers for introduction new optimized array builder array_agg(anyarray) with deconstruct_array, unchanged accumArrayResult and makeMdArrayResult: INSERT 0 1 Time: 852,527 ms INSERT 0 1 Time: 844,275

[HACKERS] [WIP Patch] Using 128-bit integers for sum, avg and statistics aggregates

2014-10-25 Thread Andreas Karlsson
Hi, There was recently talk about if we should start using 128-bit integers (where available) to speed up the aggregate functions over integers which uses numeric for their internal state. So I hacked together a patch for this to see what the performance gain would be. Previous thread:

Re: [HACKERS] INSERT ... ON CONFLICT {UPDATE | IGNORE}

2014-10-25 Thread Robert Haas
On Fri, Oct 24, 2014 at 6:48 PM, Peter Geoghegan p...@heroku.com wrote: You're conflating the user-visible syntax with the parse tree representation in way that is utterly without foundation. I don't have a position at this point on which parse-analysis representation is preferable, but it's

Re: [HACKERS] Reducing lock strength of adding foreign keys

2014-10-25 Thread Noah Misch
On Fri, Oct 24, 2014 at 12:07:42PM -0400, Robert Haas wrote: I think instead of focusing on foreign keys, we should rewind a bit and think about the locking level required to add a trigger. Agreed.

Re: [HACKERS] [PATCH] Support for Array ELEMENT Foreign Keys

2014-10-25 Thread Thom Brown
On 25 October 2014 13:28, Alvaro Herrera alvhe...@2ndquadrant.com wrote: Thom Brown wrote: On 24 October 2012 18:17, Tom Lane t...@sss.pgh.pa.us wrote: Marco Nenciarini marco.nenciar...@2ndquadrant.it writes: Please find the attached refreshed patch (v2) which fixes the loose ends

Re: [HACKERS] Getting rid of accept incoming network connections prompts on OS X

2014-10-25 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: Given that this doesn't affect make check anymore, I'm unsure about this patch. There is a lot of magic in the configure change. I don't know what to pass as the configure option argument, so can't really evaluate that. I'd like to see an explanation

Re: [HACKERS] Getting rid of accept incoming network connections prompts on OS X

2014-10-25 Thread Tom Lane
I wrote: Peter Eisentraut pete...@gmx.net writes: Have we dug deep enough into the firewall configuration to evaluate other options? Can we, for example, exclude a port range? Not that I've been able to detect. Any simple way to do that would presumably open up exactly the security hole

Re: [HACKERS] How ugly would this be? (ALTER DATABASE)

2014-10-25 Thread Greg Stark
On 24 Oct 2014 20:28, Robert Haas robertmh...@gmail.com wrote: You could perhaps try to create a command that would move a schema between two databases in the same cluster. It's fraught with practical difficulties because a single backend can't be connected to both databases at the same

Re: [HACKERS] [PATCH] Support for Array ELEMENT Foreign Keys

2014-10-25 Thread Thom Brown
On 25 October 2014 19:19, Thom Brown t...@linux.com wrote: On 25 October 2014 13:28, Alvaro Herrera alvhe...@2ndquadrant.com wrote: Thom Brown wrote: On 24 October 2012 18:17, Tom Lane t...@sss.pgh.pa.us wrote: Marco Nenciarini marco.nenciar...@2ndquadrant.it writes: Please find the

[HACKERS] Possible problem with shm_mq spin lock

2014-10-25 Thread Haribabu Kommi
Hi Hackers, I am thinking of a possible problem with shm_mq structure spin lock. This is used for protecting the shm_mq structure. During the processing of any code under the spin lock, if the process receives SIGQUIT signal then it is leading to a dead lock situation.

[HACKERS] snapshot too large error when initializing logical replication (9.4)

2014-10-25 Thread Steve Singer
I sometimes get the error snapshot too large from my logical replication walsender process when in response to a CREATE_REPLICATION_SLOT. This is in SnapBuildExportSnapshot in snapbuild.c newxcnt is 212 at that point I have max_connections = 200 procArray-maxProcs=212 Should we be testing

[HACKERS] logical decoding - reading a user catalog table

2014-10-25 Thread Steve Singer
My logical decoding plugin is occasionally getting this error could not resolve cmin/cmax of catalog tuple I get this when my output plugin is trying to read one of the user defined catalog tables (user_catalog_table=true) I am not sure if this is a bug in the time-travel support in the

Re: [HACKERS] Possible problem with shm_mq spin lock

2014-10-25 Thread Andres Freund
Hi, On 2014-10-26 08:52:42 +1100, Haribabu Kommi wrote: I am thinking of a possible problem with shm_mq structure spin lock. This is used for protecting the shm_mq structure. During the processing of any code under the spin lock, if the process receives SIGQUIT signal then it is leading to

Re: [HACKERS] Possible problem with shm_mq spin lock

2014-10-25 Thread Haribabu Kommi
On Sun, Oct 26, 2014 at 10:17 AM, Andres Freund and...@2ndquadrant.com wrote: Hi, On 2014-10-26 08:52:42 +1100, Haribabu Kommi wrote: I am thinking of a possible problem with shm_mq structure spin lock. This is used for protecting the shm_mq structure. During the processing of any code

Re: [HACKERS] Possible problem with shm_mq spin lock

2014-10-25 Thread Tom Lane
Haribabu Kommi kommi.harib...@gmail.com writes: Thanks for the details. I am sorry It is not proc_exit. It is the exit callback functions that can cause problem. The following is the callstack where the problem can happen, if the signal handler is called after the spin lock took by the

Re: [HACKERS] Possible problem with shm_mq spin lock

2014-10-25 Thread Haribabu Kommi
On Sun, Oct 26, 2014 at 12:12 PM, Tom Lane t...@sss.pgh.pa.us wrote: Haribabu Kommi kommi.harib...@gmail.com writes: Thanks for the details. I am sorry It is not proc_exit. It is the exit callback functions that can cause problem. The following is the callstack where the problem can happen,

Re: [HACKERS] Getting rid of accept incoming network connections prompts on OS X

2014-10-25 Thread Peter Eisentraut
On 10/25/14 2:52 PM, Tom Lane wrote: And a bit of experimentation later: it seems that on Yosemite (and probably earlier OS X versions), localhost maps to all three of these addresses: 127.0.0.1 ::1 fe80:1::1 Binding to 127.0.0.1 does not trigger the firewall popup.

Re: [HACKERS] Getting rid of accept incoming network connections prompts on OS X

2014-10-25 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On 10/25/14 2:52 PM, Tom Lane wrote: And a bit of experimentation later: it seems that on Yosemite (and probably earlier OS X versions), localhost maps to all three of these addresses: 127.0.0.1 ::1 fe80:1::1 Binding to 127.0.0.1 does not trigger

Re: [HACKERS] PostgreSQL Service Name Enhancement - Wildcard support for LDAP/DNS lookup

2014-10-25 Thread Doyle, Bryan
Tom, I believe there are two main concerns that you raise, addressed below: First: It needs to be a more constrained syntax. One possibility is to insist that the wildcard be only a part of the name string, eg [myservers-%] host=%.domain.com port=5433 user=admin *

Re: [HACKERS] make pg_controldata accept -D dirname

2014-10-25 Thread Michael Paquier
On Sat, Oct 25, 2014 at 1:20 AM, Heikki Linnakangas hlinnakan...@vmware.com wrote: Argh, looks like I forgot the actual code changes required. I just noticed that pg_controldata and pg_resetxlog don't check for extra arguments: $ pg_resetxlog data fds sdf sdf Transaction log reset I think

Re: [HACKERS] Index scan optimization

2014-10-25 Thread Haribabu Kommi
On Tue, Sep 23, 2014 at 10:38 PM, Rajeev rastogi rajeev.rast...@huawei.com wrote: On 22 September 2014 19:17, Heikki Linnakangas wrote: On 09/22/2014 04:45 PM, Tom Lane wrote: Heikki Linnakangas hlinnakan...@vmware.com writes: On 09/22/2014 07:47 AM, Rajeev rastogi wrote: So my proposal