Re: [GENERAL] table dependencies

2015-09-07 Thread Raymond O'Donnell
On 06/09/2015 22:59, FarjadFarid(ChkNet) wrote: > No worries. > > I found a way. > Would you share it, for the archives? Ray. -- Raymond O'Donnell :: Galway :: Ireland r...@iol.ie -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

[GENERAL] SPI_execute error handling

2015-09-07 Thread James Harper
The docs for SPI_execute at http://www.postgresql.org/docs/9.4/static/spi.html say: " Note that if a command invoked via SPI fails, then control will not be returned to your procedure. Rather, the transaction or subtransaction in which your procedure executes will be rolled back. (This might

Re: [GENERAL] SPI_execute error handling

2015-09-07 Thread Pavel Stehule
2015-09-07 11:04 GMT+02:00 James Harper : > The docs for SPI_execute at > http://www.postgresql.org/docs/9.4/static/spi.html say: > > " > Note that if a command invoked via SPI fails, then control will not be > returned to your procedure. Rather, the transaction or

Re: [GENERAL] table dependencies

2015-09-07 Thread FarjadFarid(ChkNet)
Sure, I would have but I am not sure if it would add any value. As I have a customised network adaptor and sql classes covering different databases. Best Regards Farjad -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On

Re: [GENERAL] SPI_execute error handling

2015-09-07 Thread James Harper
> Hi > > > When I need to solve similar situation, I take a code from plpgsql. > look on function exec_stmt_block. Similar code is in plpgsql_check > https://github.com/okbob/plpgsql_check/blob/master/plpgsql_check.c > Thanks. Got it sorted! James -- Sent via pgsql-general mailing list

Re: [GENERAL] table dependencies

2015-09-07 Thread Gavin Flower
On 07/09/15 19:44, Raymond O'Donnell wrote: On 06/09/2015 22:59, FarjadFarid(ChkNet) wrote: No worries. I found a way. Would you share it, for the archives? Ray. I think I can do it relatively simply, in a reasonable general fashion. if it is of real interest let me know, and I'll see

Re: [GENERAL] BDR global sequences in two machine failover

2015-09-07 Thread Giovanni Maruzzelli
On Sep 7, 2015 5:05 AM, "Craig Ringer" wrote: > > On 7 September 2015 at 00:18, Giovanni Maruzzelli wrote: > > Hello, > > > > Typical HA situation. > > > > I have master-master, two only machines, one active and one passive > > (standby) with floating

[GENERAL] Partitioning and constraint exclusion

2015-09-07 Thread Jayadevan M
Hello , I have a parent table and 6 child tables (partitions). The child tables have check constraints defined in the form CHECK (myuid in (123,456,..)). myuid is bigint, the constraints for the 6 child tables are definitely mutually exclusive. The number of values in the list ranges from 2-10

Re: [GENERAL] table dependencies

2015-09-07 Thread FarjadFarid(ChkNet)
Thanks Melvin. Much appreciate it. From: Melvin Davidson [mailto:melvin6...@gmail.com] Sent: 07 September 2015 14:38 To: Gavin Flower Cc: r...@iol.ie; FarjadFarid(ChkNet); pgsql-general Subject: Re: [GENERAL] table dependencies All, fwiw, I once wrote a plpgsql function to assist in

Re: [GENERAL] table dependencies

2015-09-07 Thread Melvin Davidson
All, fwiw, I once wrote a plpgsql function to assist in generating slony set adds. It grabs all the tables in pg_class and sorts them by foreign key count. You can pull the main query logic from it and modify to suit your needs. I've attached for your convenience. On Mon, Sep 7, 2015 at 6:27

Re: [GENERAL] Partitioning and constraint exclusion

2015-09-07 Thread Melvin Davidson
First, what is the PostgresSQL version ?? Next, in postgresql.conf, what is the value of constraint_exclusion ? On Mon, Sep 7, 2015 at 8:55 AM, Jayadevan M wrote: > Hello , > > I have a parent table and 6 child tables (partitions). The child tables > have check

Re: [GENERAL] Partitioning and constraint exclusion

2015-09-07 Thread Vick Khera
On Mon, Sep 7, 2015 at 4:48 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > IIRC ​The planner doesn't understand​ > > ​overlaps so having a definition of: > > IN (1,2,3,4,5); or nearly equivalently = ANY(ARRAY[1,2,3,4,5]))​ > > and a request for: > > IN (1,3,5) / = ANY(ARRAY[1,3,5])

Re: [GENERAL] Partitioning and constraint exclusion

2015-09-07 Thread Jayadevan M
On Mon, Sep 7, 2015 at 7:12 PM, Melvin Davidson wrote: > First, what is the PostgresSQL version ?? > 9.3.6 > > Next, in postgresql.conf, what is the value of constraint_exclusion ? > partition In response to the other possible issues pointed out - the planner is

Re: [GENERAL] Partitioning and constraint exclusion

2015-09-07 Thread David G. Johnston
On Mon, Sep 7, 2015 at 8:55 AM, Jayadevan M wrote: > Hello , > > I have a parent table and 6 child tables (partitions). The child tables > have check constraints defined in the form > CHECK (myuid in (123,456,..)). > myuid is bigint, the constraints for the 6 child

[GENERAL] jsonb value retrieval performance

2015-09-07 Thread Tom Smith
Hello: Does JSONB storage has some internal indexing(like hasmap) to fast look up a value given a key? I have a jsonb doc with two level keys (parentKey: {childKey:value}} there are maybe 2000 parent keys per doc and 100 child keys per parent key and I am trying to get value via

Re: [GENERAL] bdr admin role

2015-09-07 Thread Ray Stell
On 9/6/15 10:55 PM, Craig Ringer wrote: On 4 September 2015 at 21:46, Ray Stell wrote: FATAL: role "postgresql" does not exist It works if I init with "-U postgresql" The demo works fine if I use the string "postgresql" as the admin role. It looks like you might want to