Re: [GENERAL] jsonb_set for nested new item?

2016-09-23 Thread Deven Phillips
Thanks for the confirmation. Unfortunately, I will need to handle more complex situations. I will look into creating a recursive subroutine to handle things. On Sep 23, 2016 5:12 PM, "Vitaly Burovoy" wrote: On 9/23/16, Deven Phillips wrote: > On Fri, Sep 23, 2016 at 10:14 AM, Deven Phillips >

Re: [GENERAL] C++ port of Postgres

2016-09-23 Thread Joy Arulraj
Hi Christian -- Sorry about the delay. The patch is based on PG version 9.5.3. The commit history of the repo should give a high-level idea of the changes required in PG to support compilation by a C++ compiler. I presume that Peter's patch would be easier to integrate into PG. In any case, I would

Re: [GENERAL] jsonb_set for nested new item?

2016-09-23 Thread Vitaly Burovoy
On 9/23/16, Deven Phillips wrote: > On Fri, Sep 23, 2016 at 10:14 AM, Deven Phillips > wrote: > >> Is there a way to set a nested element for which the parent paths do not >> yet exist? >> >> For example, if I have a JSONB value called 'data': >> >> { >> "foo": "bar" >> } >> >> and run >> >>

Re: [GENERAL] journaling / time travel

2016-09-23 Thread phb07
On 09/19/2016 08:48 AM, Willy-Bas Loos wrote: > Since records can > be changed afterwards, it has been argued that we should have > "journaling", meaning that every change to the data is saved in a > separate schema that holds a "journaling" copy of each table I don't think this is especially u

Re: [GENERAL] Transactions and functions

2016-09-23 Thread Adrian Klaver
On 09/23/2016 08:44 AM, Арсен Арутюнян wrote: Hello all i have the table create table testpr(id serial,priority integer,unique(priority) DEFERRABLE, primary key(id)); and procedure: CREATE OR REPLACE FUNCTION JobPriorityChange(JobId bigint,NewPrior integer) RETURNS void AS $$ DECLARE PrevPrio

[GENERAL] Transactions and functions

2016-09-23 Thread Арсен Арутюнян
Hello all i have the table create table testpr(id serial,priority integer,unique(priority) DEFERRABLE, primary key(id)); and procedure: CREATE OR REPLACE FUNCTION JobPriorityChange(JobId bigint,NewPrior integer) RETURNS void AS $$ DECLARE PrevPrior integer; BEGIN PrevPrior := (select priority

Re: [GENERAL] jsonb_set for nested new item?

2016-09-23 Thread Deven Phillips
Actually, it looks like I have to create all of the parent objects first before it would work... Is that correct? Deven On Fri, Sep 23, 2016 at 10:14 AM, Deven Phillips wrote: > Is there a way to set a nested element for which the parent paths do not > yet exist? > > For example, if I have a JS

[GENERAL] jsonb_set for nested new item?

2016-09-23 Thread Deven Phillips
Is there a way to set a nested element for which the parent paths do not yet exist? For example, if I have a JSONB value called 'data': { "foo": "bar" } and run jsonb_set(data, {'boo', 'baz'}, 'newvalue') I would expect the output to be: { "foo": "bar", "boo": { "baz": "ne

Re: [GENERAL] Multiple inserts

2016-09-23 Thread Dorian Hoxha
If the connection is in autocommit, then each statement will also incur a commit (write to the commit log on disk). On Fri, Sep 23, 2016 at 2:01 PM, Rakesh Kumar wrote: > Hi > > I am noticing that if I do this > > insert into table values(1,a) > insert into table values(2,b) > > insert into tabl

[GENERAL] Multiple inserts

2016-09-23 Thread Rakesh Kumar
Hi I am noticing that if I do this insert into table values(1,a) insert into table values(2,b) insert into table values(3,c) commit after 500 rows it is lot slower (almost 10x) than insert into table values((1,a),(2,b),(3,c)) .. upto 500 It is obvious that the gain is due to network trip a

[GENERAL] "Re: Question about grant create on database and pg_dump/pg_dumpall"

2016-09-23 Thread Rafia Sabih
On Tue, Jul 5, 2016 at 06:39 AM, Haribabu Kommi kommi(dot)haribabu(at)gmail(dot)com wrote: Still i feel the GRANT statements should be present, as the create database statement is generated only with -C option. So attached patch produces the GRANT statements based on the -x option. The attached

Re: [GENERAL] Question about "grant create on database" and pg_dump/pg_dumpall

2016-09-23 Thread Rafia Sabih
On Tue, Jul 5, 2016 at 06:39 AM, Haribabu Kommi kommi(dot)haribabu(at)gmail(dot)com wrote: Still i feel the GRANT statements should be present, as the create database statement is generated only with -C option. So attached patch produces the GRANT statements based on the -x option. The attached