Re: [GENERAL] PG wire protocol question

2016-05-18 Thread Boszormenyi Zoltan
2016-05-17 15:29 keltezéssel, Albe Laurenz írta: Boszormenyi Zoltan wrote: it was a long time I have read this list or written to it. Now, I have a question. This blog post was written about 3 years ago: https://aphyr.com/posts/282-jepsen-postgres Basically, it talks about the client AND the s

Re: [GENERAL] Thoughts on "Love Your Database"

2016-05-18 Thread Adam Brusselback
> On Tue, May 17, 2016 at 1:54 PM, Raymond O'Donnell wrote: > > Having said all that, I've rarely had any trouble with pgAdmin 3 on > > Windows 7 and XP, Ubuntu and Debian; just a very occasional crash (maybe > > one every six months). So just to chime in, it has not been at all that stable fo

Re: [GENERAL] Thoughts on "Love Your Database"

2016-05-18 Thread David G. Johnston
On Wednesday, May 18, 2016, Adam Brusselback wrote: > > On Tue, May 17, 2016 at 1:54 PM, Raymond O'Donnell > wrote: > >> > Having said all that, I've rarely had any trouble with pgAdmin 3 on > >> > Windows 7 and XP, Ubuntu and Debian; just a very occasional crash (maybe > >> > one every six mont

[GENERAL] Use of array_agg and array string on inner query

2016-05-18 Thread shankha
I have the following piece of code: DROP SCHEMA IF EXISTS s CASCADE; CREATE SCHEMA s; CREATE TABLE "s"."t1" ( "c1" BigSerial PRIMARY KEY, "c2" BigInt NOT NULL, "c3" BigInt ) WITH (OIDS=FALSE); INSERT INTO s.t1 (c2) VALUES (10); INSERT INTO

Re: [GENERAL] Thoughts on "Love Your Database"

2016-05-18 Thread Pierre Chevalier Géologue
Hi, Le 17/05/2016 10:44, John R Pierce a écrit : On 5/17/2016 1:34 AM, Pierre Chevalier Géologue wrote: On this matter, I hear *very* often from such guys that the only reproach they have to PostgreSQL is that it does not come with a slick GUI like Access. Access is a lot more than a slick G

Re: [GENERAL] Use of array_agg and array string on inner query

2016-05-18 Thread Sameer Kumar
On Thu, May 19, 2016 at 1:09 AM shankha wrote: > I have the following piece of code: > > DROP SCHEMA IF EXISTS s CASCADE; > CREATE SCHEMA s; > > CREATE TABLE "s"."t1" > ( > "c1" BigSerial PRIMARY KEY, > "c2" BigInt NOT NULL, > "c3" BigInt > ) > WITH

Re: [GENERAL] Thoughts on "Love Your Database"

2016-05-18 Thread Pierre Chevalier Géologue
Le 17/05/2016 11:25, Geoff Winkless a écrit : but they are still looking for a sort of Holy Grail that would definitely convince them. A standard client tool that would come with any PostgreSQL installation would please them. Some sort of psqlGUI, I guess. Why reinvent the wheel? I would say

Re: [GENERAL] Thoughts on "Love Your Database"

2016-05-18 Thread Pierre Chevalier Géologue
Interesting point of view. Time to make a bug report, isn't it? ;-) À+ Pierre Le 18/05/2016 17:44, Adam Brusselback a écrit : On Tue, May 17, 2016 at 1:54 PM, Raymond O'Donnellmailto:r...@iol.ie>> wrote: Having said all that, I've rarely had any trouble with pgAdmin 3 on Windows 7 and

Re: [GENERAL] Use of array_agg and array string on inner query

2016-05-18 Thread shankha
The original table is : c1 c2 c3 110 220 10 320 10 So c3 of row 3 and row 2 are equal to c2 of row 1. The output I am looking for is : c1 | array_to_string +- 1 | 2,3 2 | 3 | (3 rows) How Can I modify this query : SELECT c1, c2,

Re: [GENERAL] Use of array_agg and array string on inner query

2016-05-18 Thread David G. Johnston
On Wed, May 18, 2016 at 1:07 PM, shankha wrote: > > /* 3. */ SELECT c1, c2, > ARRAY_TO_STRING(ARRAY_AGG((SELECT t3.c1 FROM s.t1 as t3 JOIN s.t1 > as t2 ON t3.c3 = t2.c2)), ',') > FROM s.t1 t1 > GROUP BY c1; > DROP SCHEMA s CASCADE; > ​The following adjustments should work:​

Re: [GENERAL] Thoughts on "Love Your Database"

2016-05-18 Thread John R Pierce
On 5/18/2016 11:05 AM, Pierre Chevalier Géologue wrote: Yes, that's it, in a way. Although designing forms is not what I would call AD (application development)... When you look back at dBase III or IV, the text user interface which allowed to interact with the data was very simple, and effic

Re: [GENERAL] Use of array_agg and array string on inner query

2016-05-18 Thread Sameer Kumar
On Thu, 19 May 2016, 2:07 a.m. shankha, wrote: > The original table is : > > c1 c2 c3 > 110 > 220 10 > 320 10 > > So c3 of row 3 and row 2 are equal to c2 of row 1. > > > The output I am looking for is : > c1 | array_to_string > +- >1 | 2,3 >2

Re: [GENERAL] Use of array_agg and array string on inner query

2016-05-18 Thread shankha
I cannot move the array_agg to around the column name. It has to work as a inner query. I will try out your other suggestion. Thanks Shankha Banerjee On Wed, May 18, 2016 at 2:26 PM, Sameer Kumar wrote: > > > On Thu, 19 May 2016, 2:07 a.m. shankha, wrote: >> >> The original table is : >> >> c1

Re: [GENERAL] Use of array_agg and array string on inner query

2016-05-18 Thread David G. Johnston
On Wed, May 18, 2016 at 2:30 PM, shankha wrote: > I cannot move the array_agg to around the column name. It has to work > as a inner query > ​. > ​The following form is used to make an array from a subquery: SELECT ARRAY(SELECT i FROM ( VALUES (1), (2), (3) ) vals (i) );​ ​ ​ http://www.postgr

[GENERAL] Londiste 3 pgq events_1_1 table huge

2016-05-18 Thread Leonardo M . Ramé
Hi, I couldn't find a mailing list or forum to ask londiste related questions, so I hope someone from this list can help me with this. I have a Londiste based replication setup that is working perfectly since last year. Now I noted the events_1_1 table grew too much (almost exactly the same si

Re: [GENERAL] Londiste 3 pgq events_1_1 table huge

2016-05-18 Thread Rene .
Hi, Check for long running Idle in transaction sessions. Idle in transaction sessions may holding events table from cleaning itself up. If there is more then days long running idle in transaction sessions, kill them, event table should be cleaned automatically after that. "select pid,state, quer

[GENERAL] first_value/last_value

2016-05-18 Thread Tom Smith
Hello: Is there a plan for 9.7 to enable using the two aggregate function as non-window function? i.e. enabling getting the first/last row in single sql without using window features. There is actually a C-extension for first()/last(). I am wondering if 9.7 would make them built-in function

Re: [GENERAL] first_value/last_value

2016-05-18 Thread Adam Brusselback
Is there a reason you can't do that now with a limit 1/order by/union all? Just have it ordered one way on the first query and the other on the bottom. That will give you two rows that are the first / last in your set based on whatever column you order on. On May 18, 2016 8:47 PM, "Tom Smith" wrot

Re: [GENERAL] first_value/last_value

2016-05-18 Thread David G. Johnston
On Wednesday, May 18, 2016, Tom Smith wrote: > Hello: > > Is there a plan for 9.7 to enable using the two aggregate function > as non-window function? i.e. enabling getting the first/last row > in single sql without using window features. > There is actually a C-extension for first()/last().

Re: [GENERAL] first_value/last_value

2016-05-18 Thread Tom Smith
I need to use both in single sql. On Wed, May 18, 2016 at 9:08 PM, Adam Brusselback wrote: > Is there a reason you can't do that now with a limit 1/order by/union all? > Just have it ordered one way on the first query and the other on the > bottom. That will give you two rows that are the first

Re: [GENERAL] first_value/last_value

2016-05-18 Thread Adam Brusselback
Here is an example that works in a single query. Since you have two different orders you want the data back in, you need to use subqueries to get the proper data back, but it works, and is very fast. CREATE TEMPORARY TABLE foo AS SELECT generate_series as bar FROM generate_series(1, 100); CR

Re: [GENERAL] first_value/last_value

2016-05-18 Thread Melvin Davidson
On Wed, May 18, 2016 at 10:36 PM, Adam Brusselback < adambrusselb...@gmail.com> wrote: > Here is an example that works in a single query. Since you have two > different orders you want the data back in, you need to use subqueries to > get the proper data back, but it works, and is very fast. > >

Re: [GENERAL] first_value/last_value

2016-05-18 Thread Tom Smith
It would really save all the troubles for many people if postgresql has a built-in first/last function along with sum/avg. There is already a C extension and a wiki sample and implemented for window function. I am curious why these two functions were not added along their window implementation