Re: [OT] Concurrent psql API - Mailing list pgsql-hackers

From Csaba Nagy
Subject Re: [OT] Concurrent psql API
Date
Msg-id 1207816314.8259.214.camel@PCD12478
Whole thread Raw
In response to Re: Concurrent psql API  (Decibel! <decibel@decibel.org>)
List pgsql-hackers
> I find myself doing this frequently with any long-running command,  
> but currently it's a PITA because I'd doing it at the shell level and  
> firing up a new psql: more work than should be necessary, and psql  
> sometimes gets confused when you resume it from the background in  
> interactive mode (stops echoing characters, though maybe this has  
> been fixed).

I would recommend trying out the 'screen' utility (see my other post
too). And here you find a nice .screenrc too which will show you a
status bar of your active session, I find it super cool (and it's well
commented if you don't like it as it is):

http://home.insightbb.com/~bmsims1/Scripts/Screenrc.html

The man page has all commands you need, the most used by me:

Ctrl-a Ctrl-c -> open a new session;
Ctrl-a A -> name the session 8will show up with that name in the status
bar, note that the second key is a capital A not a);
Ctrl-a Ctrl-a -> switch to the last viewed session;
Ctrl-a <n> -> switch to the <n>th session, where <n> is a digit 0-9

I usually leave the screen sessions running end detach only the
terminal, and then I can connect again to the already set up sessions
using "screen -R". It's a real time saver.

It has many more facilities, and creating a new psql session is just
Ctrl-a Ctrl-c and then type in psql... and you're good to go... I don't
think you can beat that by a large margin with psql-intern commands (you
still need to type in something extra), and you do have added benefits
of clearly separated workflows and a nice overview of it.

Cheers,
Csaba.




pgsql-hackers by date:

Previous
From: Stefan Kaltenbrunner
Date:
Subject: Re: Commit fest queue
Next
From: "Ashish Sharma"
Date:
Subject: Re: SQL fast in PSQL, very slow using MS.NET driver