Re: Oracle Associate Array conversion to PostgreSQL

2020-09-09 Thread Pavel Stehule
Hi čt 10. 9. 2020 v 7:12 odesílatel JAGMOHAN KAINTURA < jagmohan.kaint...@gmail.com> napsal: > Hi All, > > Since we don't have the support of Associative arrays in Postgres, we need > to convert Oracle associative arrays with a different approach in > PostgreSQL. > > Following is a sample piece o

Oracle Associate Array conversion to PostgreSQL

2020-09-09 Thread JAGMOHAN KAINTURA
Hi All, Since we don't have the support of Associative arrays in Postgres, we need to convert Oracle associative arrays with a different approach in PostgreSQL. Following is a sample piece of code to demonstrate the same. --Convert Oracle RECORD type to PostgreSQL TYPE. --===

Re: Unexpected results when using GROUP BY GROUPING SETS and bind variables

2020-09-09 Thread Aner Perez
Of course, right when I hit send I thought of another option that makes the SQL a little less readable but perhaps gets rid of the ambiguity. Using ordinals in the GROUP BY: SELECT path[1], path[2], path[3], path[4], sum(value) FROM bind_group_by GROUP BY GROUPING SETS ( (1, 2, 3, 4), (1,

Re: Unexpected results when using GROUP BY GROUPING SETS and bind variables

2020-09-09 Thread Tom Lane
Aner Perez writes: > Or if using indexed path elements in the GROUP BY is the issue and I should > put the array indexing in a subselect and do the aggregation in the outer > select. Like this: > -- Safer Subselect Version -- > SELECT level1, level2, level3, level4, sum(value) > FROM ( > SEL

Re: Unexpected results when using GROUP BY GROUPING SETS and bind variables

2020-09-09 Thread Aner Perez
Thanks Tom, I figured as much about the second query but I thought it would be safe to use the first version with the inlined indexing. I'm not sure if you're saying that the same query without the unindexed path column in the select would be safe. Like this: -- Do not GROUP BY or SELECT on path

Re: Network performance optimization

2020-09-09 Thread Francisco Olarte
Fabio: On Wed, Sep 9, 2020 at 1:05 PM Fabio Ugo Venchiarutti wrote: > Even if network datagrams moved at the speed of light and with no > serialisation/forwarding delay (which they don't), you're still going to > deal with several thousand KMs of distance; I'm positively surprised > you're gettin

Re: Unexpected results when using GROUP BY GROUPING SETS and bind variables

2020-09-09 Thread Tom Lane
Aner Perez writes: > [ these queries don't give the same results: ] > SELECT path[1], path[2], path[3], path, sum(value) > FROM bind_group_by > GROUP BY GROUPING SETS ( > (path[1], path[2], path[3], path), > (path[1], path[2], path[3]), > (path[1], path[2]), > (path[1]), > ()

Unexpected results when using GROUP BY GROUPING SETS and bind variables

2020-09-09 Thread Aner Perez
I wrote a query for a report that needed to summarize table data for different subsets of an ARRAY column. Once I had a working query, I recreated it in my code using an SQL query builder (the awesome jOOQ in this case). Unfortunately the output from the generated SQL was different from the handw

Re: BUG? Slave don't reconnect to the master

2020-09-09 Thread Jehan-Guillaume de Rorthais
On Mon, 7 Sep 2020 23:46:17 +0300 Олег Самойлов wrote: > [...] > >>> why did you add "monitor interval=15"? No harm, but it is redundant with > >>> "monitor interval=16 role=Master" and "monitor interval=17 > >>> role=Slave". > >> > >> I can't remember clearly. :) Look what happens without

Re: Schema/ROLE Rename Issue

2020-09-09 Thread Brajendra Pratap Singh
Thank you Albe.. Could u plz suggest me the best way to get the definition of functions via connecting through psql as while I am trying to change the definition through \ef function_name it won't reflect the changes. Thanks Brajendra On Wed, 9 Sep, 2020, 7:39 PM Laurenz Albe, wrote: > On Wed,

Re: Schema/ROLE Rename Issue

2020-09-09 Thread Laurenz Albe
On Wed, 2020-09-09 at 17:04 +0530, Brajendra Pratap Singh wrote: > Recently we had renamed schema and role but it will not get reflect in the > object definitions ,plz suggest. > > OLD SCHEMA/ROLE - TEST11 > NEW SCHEMA/ROLE - TEST > > But still we are that TEST11 is present in the definition

Re: Autovacuum of independent tables

2020-09-09 Thread Stephen Frost
Greetings, * Michael Holzman (michaelholz...@gmail.com) wrote: > I have two applications A and B. A runs SELECT statements only and only on > tableA. B actively updates tableB, A never looks into tableB. B has nothing > to do with tableA. In an ideal world, such distinct applications would probab

Schema/ROLE Rename Issue

2020-09-09 Thread Brajendra Pratap Singh
Hi, Recently we had renamed schema and role but it will not get reflect in the object definitions ,plz suggest. OLD SCHEMA/ROLE - TEST11 NEW SCHEMA/ROLE - TEST But still we are that TEST11 is present in the definition of sone objects like procudure,functions,triggers etc, so how can we modify

Re: Network performance optimization

2020-09-09 Thread Fabio Ugo Venchiarutti
On 09/09/2020 04:59, J . Mageshwaran wrote: Hi Team, I am performing some benchmark testing with application in aws east 2 and dB in East 1. I am using pgbench for benchmark, the RTT Latency between East 1 to east2 is some where between 12 to 16 ms on an average. Is there any optimization that

Re: Network performance optimization

2020-09-09 Thread Fabio Pardi
Hi, use of a connection pooler usually helps in such cases. It will not reduce latency, but it will mitigate the problem when the app can benefit from recycling the connections. regards, fabio pardi On 09/09/2020 06:59, J . Mageshwaran wrote: > Hi Team, I am performing some benchmark testing

Network performance optimization

2020-09-09 Thread J . Mageshwaran
Hi Team, I am performing some benchmark testing with application in aws east 2 and dB in East 1. I am using pgbench for benchmark, the RTT Latency between East 1 to east2 is some where between 12 to 16 ms on an average. Is there any optimization that can be done to reduce the latency and increase t