Re: [BUGS] BUG #5370: Shortcut for currently connected users

2010-03-12 Thread Igor Moiseev
Thank you Bruce! This solution is even more flexible!

But how is it possible to know if the docs gives almost nothing

http://search.postgresql.org/search?u=/docs/8.4/static/q=psqlrc


Thank you.

2010/3/12 Bruce Momjian br...@momjian.us

 Igor Moiseev wrote:
 
  The following bug has been logged online:
 
  Bug reference:  5370
  Logged by:  Igor Moiseev
  Email address:  moiseev.i...@gmail.com
  PostgreSQL version: 8.3.9
  Operating system:   Ubuntu
  Description:Shortcut for currently connected users
  Details:
 
  Dear developers, thank you for the perfect product!
 
  I'd like to request one shortcut in psql terminal. That would simplify a
 lot
  manual administrating of postgresql servers! The query I need always to
  execute is
 
  select * from pg_stat_activity ;
 
  That would be nice to have something like \cu as a shortcut for this
  query!!

 Add this to your ~/.psqlrc:

\set mon 'SELECT * FROM pg_stat_activity';

 and then you can use this in psql:

test= :mon
 datid | datname | procpid | usesysid | usename  | application_name
 |
 ...

 --
  Bruce Momjian  br...@momjian.ushttp://momjian.us
  EnterpriseDB http://enterprisedb.com

  PG East:  http://www.enterprisedb.com/community/nav-pg-east-2010.do




-- 
_)) __  __  __
(( ((_( ((_)(|
_)) moiseev.i...@gmail.com


Re: [BUGS] BUG #5370: Shortcut for currently connected users

2010-03-12 Thread Robert Haas
On Fri, Mar 12, 2010 at 4:59 AM, Igor Moiseev moiseev.i...@gmail.com wrote:
 Thank you Bruce! This solution is even more flexible!
 But how is it possible to know if the docs gives almost nothing

 http://search.postgresql.org/search?u=/docs/8.4/static/q=psqlrc

The first of those two hits is an extremely long and detailed page
about psql which does in fact cover variable interpolation.

Now maybe it needs to be broken up into multiple, shorter pages, but
the information is there.

...Robert

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


[BUGS] BUG #5370: Shortcut for currently connected users

2010-03-11 Thread Igor Moiseev

The following bug has been logged online:

Bug reference:  5370
Logged by:  Igor Moiseev
Email address:  moiseev.i...@gmail.com
PostgreSQL version: 8.3.9
Operating system:   Ubuntu
Description:Shortcut for currently connected users
Details: 

Dear developers, thank you for the perfect product!

I'd like to request one shortcut in psql terminal. That would simplify a lot
manual administrating of postgresql servers! The query I need always to
execute is

select * from pg_stat_activity ;

That would be nice to have something like \cu as a shortcut for this
query!!

Thank you!
_)) __  __  __ 
(( ((_( ((_)(|  
_)) moiseev.i...@gmail.com

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


Re: [BUGS] BUG #5370: Shortcut for currently connected users

2010-03-11 Thread Bruce Momjian
Igor Moiseev wrote:
 
 The following bug has been logged online:
 
 Bug reference:  5370
 Logged by:  Igor Moiseev
 Email address:  moiseev.i...@gmail.com
 PostgreSQL version: 8.3.9
 Operating system:   Ubuntu
 Description:Shortcut for currently connected users
 Details: 
 
 Dear developers, thank you for the perfect product!
 
 I'd like to request one shortcut in psql terminal. That would simplify a lot
 manual administrating of postgresql servers! The query I need always to
 execute is
 
 select * from pg_stat_activity ;
 
 That would be nice to have something like \cu as a shortcut for this
 query!!

Add this to your ~/.psqlrc:

\set mon 'SELECT * FROM pg_stat_activity';

and then you can use this in psql:

test= :mon
 datid | datname | procpid | usesysid | usename  | application_name |   
 ...

-- 
  Bruce Momjian  br...@momjian.ushttp://momjian.us
  EnterpriseDB http://enterprisedb.com

  PG East:  http://www.enterprisedb.com/community/nav-pg-east-2010.do

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