Re: Results messages in "results output" window - Mailing list pgadmin-support

From Guillaume Lelarge
Subject Re: Results messages in "results output" window
Date
Msg-id CAECtzeWH1s6sea_-bYAxaPE0dpaTKjo8y5BL+uDymCyjuPm4PQ@mail.gmail.com
Whole thread Raw
In response to Re: Results messages in "results output" window  ("J.F. Oster" <jinfroster@mail.ru>)
List pgadmin-support
2015-02-13 19:09 GMT+01:00 J.F. Oster <jinfroster@mail.ru>:
Hello Edson,

Friday, February 13, 2015, 8:54:58 PM, you wrote:

ER> On 13-02-2015 15:46, Guillaume Lelarge      wrote:

ER> Le 13 fevr. 2015 18:39, "Edson Richter"
ER> <edsonrichter@hotmail.com>        a ecrit :
 >>
 >> Dear friends,
 >>
 >> I've been using PgAdmin 12.0.0 released on Jan 6, 2015,
 >> compiled in my Ubuntu 14.04 x64.
 >> Nothing noticiable in terms of use (actually, there are few
 >> known bugs, but they don't bug me anyway).
 >>
 >> I would like to know if there is any change to enable
 >> processing results to appear in Results output window when
 >> running a script the this one:
 >>
 >> begin transaction;
 >> update mytable set factor_xy = 10 where factor_xy = 15 and    nature_id = 4;
 >> commit transaction;
 >>
 >> Today I get the following output:
 >>
 >> [QUERY═══ ] begin transaction
 >> [QUERY═══ ] update mytable set factor_xy = 10 where
 >> factor_xy = 15 and nature_id = 4
 >> [QUERY═══ ] rollback transaction
 >>
 >> I would like to get something like:
 >>
 >> [QUERY═══ ] begin transaction
 >> 0 rows changed.
 >> [QUERY═══ ] update mytable set factor_xy = 10 where
 >> factor_xy = 15 and nature_id = 4
 >> 16 rows changed.
 >> [QUERY═══ ] rollback transaction
 >> 0 rows changed.
 >>
 >>
 >> Is there any configuration I can change to get this?
 >>


ER> Nope. There's nothing for this.


ER>  Ok, I see. So, results window is almost useless when running scripts...
ER>  Any tip on where to look if I can provide a patch for this?

Hi! As far as I know, pgAdmin sends the whole query text to Postgres
"as-is". Then, Postgres parses it and executes as a series of queries,
returning output related to the last one. So, first of all pgAdmin
should split the text into separate queries and perform them serially.
Then it can append results to the output window (and probably
render several result grids in a tabbed manner - cool!).


Well, I have looked into the several result grids, and AFAIR, you don't need to split the queries to make it work. The main issue for this feature is a UI issue. (And then a time issue, as you need time to work on this.)
 
How to parse query text and split it into separate queries? I hope
that code related to pgScript feature will help.


Correct, but don't hold your breath.


--

pgadmin-support by date:

Previous
From: "J.F. Oster"
Date:
Subject: Re: Results messages in "results output" window
Next
From: Albe Laurenz
Date:
Subject: REFRESH MATERIALIZED VIEW blocks pgAdmin III login