pg_top

Started by Brett Matonabout 13 years ago7 messages
#1Brett Maton
matonb@ltresources.co.uk
1 attachment(s)

Hi List,

This might not be the right place to post, but I've got a minor patch for
pg_top and would like to submit it for review.

Basically, the rpm version in the repositories pg_top92-3.6.2 doesn't work
with Postgres 9.2

#define QUERY_PROCESSES \

"SELECT procpid\n" \

"FROM pg_stat_activity;"

It appears that procpid has been renamed to pid at some point, also the
column current_query appears to have been shortened to query.

My patch updates a couple of queries to use the new shorter column names.

Where or who should I submit the changes to?

Thanks,

Brett

_____

Brett Maton
t: +44 (0) 2392 658 264
m: +44 (0) 7427 610 472
e: <mailto:matonb@ltresources.co.uk> matonb@ltresources.co.uk

<http://www.ltresources.co.uk/&gt; Description:
http://www.ltresources.co.uk/logow.png

Attachments:

image003.pngimage/png; name=image003.pngDownload
#2P. Christeas
xrg@linux.gr
In reply to: Brett Maton (#1)
Re: pg_top

On Thursday 20 December 2012, Brett Maton wrote:

Hi List,

This might not be the right place to post, but I've got a minor patch for
pg_top and would like to submit it for review.

This project lies on Github:
https://github.com/markwkm/pg_top/

I think, this commit had fixed the issue you are talking about:
https://github.com/markwkm/pg_top/commit/a211ac3f161d7ec2752ed038009f93b4f470e86c

--
Say NO to spam and viruses. Stop using Microsoft Windows!

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Brett Maton
matonb@ltresources.co.uk
In reply to: P. Christeas (#2)
Re: pg_top

Ah, I cloned the repository from git://git.postgresql.org/

I'll have a look at Marks repo.

Thanks,
Brett

-----Original Message-----
From: pgsql-hackers-owner@postgresql.org
[mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of P. Christeas
Sent: 20 December 2012 12:33
To: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] pg_top

On Thursday 20 December 2012, Brett Maton wrote:

Hi List,

This might not be the right place to post, but I've got a minor
patch for pg_top and would like to submit it for review.

This project lies on Github:
https://github.com/markwkm/pg_top/

I think, this commit had fixed the issue you are talking about:
https://github.com/markwkm/pg_top/commit/a211ac3f161d7ec2752ed038009f93b4f47
0e86c

--
Say NO to spam and viruses. Stop using Microsoft Windows!

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4John R Pierce
pierce@hogranch.com
In reply to: Brett Maton (#1)
Re: pg_top

On 12/20/2012 4:17 AM, Brett Maton wrote:

It appears that procpid has been renamed to pid at some point, also
the column current_query appears to have been shortened to query.

My patch updates a couple of queries to use the new shorter column names.

IMHO, any such fix should check the version, and use the old name for <
9.2, and new for >= 9.2

/me tossed another mumbled curse at whomever changed that field name.

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: John R Pierce (#4)
Re: pg_top

John R Pierce <pierce@hogranch.com> writes:

/me tossed another mumbled curse at whomever changed that field name.

The reason for the field name change was that the semantics of the field
changed. You typically ought to look at what the application is
actually doing with the field, not just do s/current_query/query/g
and expect that all will be well. (In particular, if the app is looking
for "idle" or "idle in transaction" state markers, it's going to need
more adjustment than that.)

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#6Merlin Moncure
mmoncure@gmail.com
In reply to: Tom Lane (#5)
Re: pg_top

On Thu, Dec 20, 2012 at 4:17 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

John R Pierce <pierce@hogranch.com> writes:

/me tossed another mumbled curse at whomever changed that field name.

The reason for the field name change was that the semantics of the field
changed. You typically ought to look at what the application is
actually doing with the field, not just do s/current_query/query/g
and expect that all will be well. (In particular, if the app is looking
for "idle" or "idle in transaction" state markers, it's going to need
more adjustment than that.)

IMSNHO, neither of these should have been changed, I would much rather
have seen a new view or some other way of opting into the new
functionality.

merlin

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#7Brett Maton
matonb@ltresources.co.uk
In reply to: Merlin Moncure (#6)
Re: pg_top

As it turns out Mark Wong's pg_top project / branch
https://github.com/markwkm/pg_top/ has been patched and looks like it will
cope with the current column names and their previous incarnation.

I don't think I would ever have found it unless P. Christeas had pointed it
out. I cloned the source from git.postgresql.org which I assumed would be
the latest code....
Google searches point you mostly to pgfoundry, which seems to be out of date
(pg_top that is) and most links in the foundry take you to a "page not
found".

I suppose the question now is git.postgresql.org where I should expect to
find the latest code, stable or otherwise...

Thanks,
Brett

-----Original Message-----
From: pgsql-hackers-owner@postgresql.org
[mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of Merlin Moncure
Sent: 20 December 2012 22:24
To: Tom Lane
Cc: John R Pierce; pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] pg_top

On Thu, Dec 20, 2012 at 4:17 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

John R Pierce <pierce@hogranch.com> writes:

/me tossed another mumbled curse at whomever changed that field name.

The reason for the field name change was that the semantics of the
field changed. You typically ought to look at what the application is
actually doing with the field, not just do s/current_query/query/g and
expect that all will be well. (In particular, if the app is looking
for "idle" or "idle in transaction" state markers, it's going to need
more adjustment than that.)

IMSNHO, neither of these should have been changed, I would much rather have
seen a new view or some other way of opting into the new functionality.

merlin

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make
changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers