Re: [BUGS] [GENERAL] Need guidance on regression.diffs

2014-10-29 Thread Romu Hu
On 2014/10/29 11:23, Tom Lane wrote: Michael Paquier michael.paqu...@gmail.com writes: On Wed, Oct 29, 2014 at 10:44 AM, Romu Hu huru...@gmail.com wrote: I ran the test against an existing installation (redhat enterprise linux software collection postgresql92). The postgres server and the

[GENERAL] Appending new data to existing field of Json data type

2014-10-29 Thread VENKTESH GUTTEDAR
Hello, As i am new to postgresql, i am learning through experimenting things. i have a table with json data type field, so there is some data for example : { [ { a:b, b:c } ] } and now if i append data then it should be like : { [ { a:b, b:c }, { e:f, g:h } ] }

[GENERAL] Need Guidance on Appending new data to existing field of Json data type

2014-10-29 Thread VENKTESH GUTTEDAR
Hello, As i am new to Postgresql, i am learning through experimenting things. i have a table with json data type field, so there is some data for example : { [ { a:b, b:c } ] } and now if i append data then it should be like : { [ { a:b, b:c }, { e:f, g:h } ] }

Re: [GENERAL] How to find earlest possible start times for given duration excluding reservations

2014-10-29 Thread Andrus
Hi! A further tweak; add the following to the WHERE clause: AND EXTRACT(DOW FROM times.period) != 0 I changed it to isodow to work in any locale. Your solution is more readable but Erwin answer in SO looks more optimized. I have 10 workes and 1 month reservation with 15 minute offsess from

Re: [GENERAL] Appending new data to existing field of Json data type

2014-10-29 Thread Michael Paquier
On Wed, Oct 29, 2014 at 3:42 PM, VENKTESH GUTTEDAR venkteshgutte...@gmail.com wrote: As i am new to postgresql, i am learning through experimenting things. i have a table with json data type field, so there is some data for example : { [ { a:b, b:c } ] } and now if i

Re: [GENERAL] Appending new data to existing field of Json data type

2014-10-29 Thread VENKTESH GUTTEDAR
Ya agreed thats not legal JSON, that was typing mistake sorry for that, let me make you clear what i need exactly, I have table named (exampleTable) with json field as (example_list), and when i say SELECT * FROM exampleTable; id | example_list ---+--

[GENERAL] undefined struct 'pg_conn' on Windows7

2014-10-29 Thread Brilliantov Kirill Vladimirovich
Hello! I install postgre from postgresql-9.3.5-3-windows-x64.exe file and try use libpq.lib from it. My system Windows7 ServicePack1 and I use VisualStudioExpress 12 for write code. I add path to postgre_install_dir\include and postgre_install_dir\lib in project and include libpq-fe.h file.

Re: [GENERAL] undefined struct 'pg_conn' on Windows7

2014-10-29 Thread Albe Laurenz
Brilliantov Kirill Vladimirovich wrote: I install postgre from postgresql-9.3.5-3-windows-x64.exe file and try use libpq.lib from it. My system Windows7 ServicePack1 and I use VisualStudioExpress 12 for write code. I add path to postgre_install_dir\include and postgre_install_dir\lib in

Re: [GENERAL] undefined struct 'pg_conn' on Windows7

2014-10-29 Thread Brilliantov Kirill Vladimirovich
Albe Laurenz wrote on 10/29/2014 11:57 AM: Any chance that you use a variable of type PGconn when it should be PGconn* ? Hello and thank you for your reply! Yes, you right, problem solved after change PGconn on PGconn*. -- Best regards, Brilliantov Kirill Vladimirovich -- Sent via

Re: [GENERAL] Appending new data to existing field of Json data type

2014-10-29 Thread Adrian Klaver
On 10/29/2014 01:06 AM, VENKTESH GUTTEDAR wrote: Ya agreed thats not legal JSON, that was typing mistake sorry for that, let me make you clear what i need exactly, I have table named (exampleTable) with json field as (example_list), and when i say SELECT * FROM exampleTable; id | example_list

Re: [GENERAL] Query optimization

2014-10-29 Thread Jorge Arevalo
Hello David, many thanks for your responses, Sorry for not providing the content of the fill_table3_function, but it just executes 3 insert queries in 3 different tables. And I've checked the time consuming operation is in this query (by the way, there was a little mistake in the name of the

Re: [GENERAL] Query optimization

2014-10-29 Thread David Johnston
List preference is to inline post or, at worse, bottom post. Please do not top post. On Wed, Oct 29, 2014 at 11:06 AM, Jorge Arevalo jorgearev...@libregis.org wrote: Hello David, many thanks for your responses, Sorry for not providing the content of the fill_table3_function, but it just

Re: [GENERAL] Query optimization

2014-10-29 Thread Tom Lane
Jorge Arevalo jorgearev...@libregis.org writes: SELECT value1,value2,value3,value4, value5, hstore(ARRAY['field9', 'field10', 'field11', 'field12', 'field13', 'field14'], ARRAY[field9, field10, field11, field12, field13, field14) as metadata, value7, (select array((select row(f1, f2) from

Re: [GENERAL] Query optimization

2014-10-29 Thread David Johnston
On Wed, Oct 29, 2014 at 11:53 AM, Tom Lane t...@sss.pgh.pa.us wrote: Jorge Arevalo jorgearev...@libregis.org writes: This is the result of EXPLAIN ANALYZE QUERY PLAN

Re: [GENERAL] Query optimization

2014-10-29 Thread Jorge Arevalo
On Wed, Oct 29, 2014 at 8:05 PM, David Johnston david.g.johns...@gmail.com wrote: On Wed, Oct 29, 2014 at 11:53 AM, Tom Lane t...@sss.pgh.pa.us wrote: Jorge Arevalo jorgearev...@libregis.org writes: This is the result of EXPLAIN ANALYZE

Re: [GENERAL] Query optimization

2014-10-29 Thread Tom Lane
Jorge Arevalo jorgearev...@libregis.org writes: On Wed, Oct 29, 2014 at 11:53 AM, Tom Lane t...@sss.pgh.pa.us wrote: I'm also a bit confused as to why the planner is saying that the (SELECT ARRAY(...)) bit is an InitPlan and not a SubPlan. That implies that field7 in the innermost WHERE

Re: [GENERAL] Query optimization

2014-10-29 Thread David Johnston
On Wed, Oct 29, 2014 at 12:14 PM, Jorge Arevalo jorgearev...@libregis.org wrote: SELECT value1,value2,value3,value4, value5, hstore(ARRAY['field9', 'field10', 'field11', 'field12', 'field13', 'field14'], ARRAY[field9, field10, field11, field12, field13, field14]) as metadata, value7, (select

Re: [GENERAL] Query optimization

2014-10-29 Thread Jorge Arevalo
On Wed, Oct 29, 2014 at 8:47 PM, David Johnston david.g.johns...@gmail.com wrote: On Wed, Oct 29, 2014 at 12:14 PM, Jorge Arevalo jorgearev...@libregis.org wrote: SELECT value1,value2,value3,value4, value5, hstore(ARRAY['field9', 'field10', 'field11', 'field12', 'field13', 'field14'],