detached query?

Started by Yves Dorfsmanalmost 11 years ago4 messagesgeneral
Jump to latest
#1Yves Dorfsman
yves@zioup.com

On 9.3, is there any way to start a query, detach from the server and have the
query keep going (long query that updates tables, but nothing is returned)?

Thanks.

--
http://yves.zioup.com
gpg: 4096R/32B0F416

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

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: Yves Dorfsman (#1)
Re: detached query?

On Wed, May 6, 2015 at 3:37 PM, Yves Dorfsman <yves@zioup.com> wrote:

On 9.3, is there any way to start a query, detach from the server and have
the
query keep going (long query that updates tables, but nothing is returned)?

​No. Sessions require an external client to maintain its connection.

David J.

#3Melvin Davidson
melvin6925@gmail.com
In reply to: David G. Johnston (#2)
Re: detached query?

Although not a PostgreSQL utility, in Linux, you can use screen or tmux to
establish a connection and then disconnect.

On Wed, May 6, 2015 at 6:48 PM, David G. Johnston <
david.g.johnston@gmail.com> wrote:

On Wed, May 6, 2015 at 3:37 PM, Yves Dorfsman <yves@zioup.com> wrote:

On 9.3, is there any way to start a query, detach from the server and
have the
query keep going (long query that updates tables, but nothing is
returned)?

​No. Sessions require an external client to maintain its connection.

David J.

--
*Melvin Davidson*
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.

#4Tim Clarke
tim.clarke@manifest.co.uk
In reply to: Melvin Davidson (#3)
Re: detached query?

We do this

nohup psql -U (username) -W -f (sqlquery script) (database) &&

on our linux boxes all the time to run a long query or sequence of them.
If its a scheduled job it just goes into cron and you don't need the
"nohup" or trailing "&&". Let me know if you'd like me to break all that
apart for you.

Tim Clarke

Show quoted text

On 07/05/15 02:15, Melvin Davidson wrote:

Although not a PostgreSQL utility, in Linux, you can use screen or
tmux to establish a connection and then disconnect.

On Wed, May 6, 2015 at 6:48 PM, David G. Johnston
<david.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com>> wrote:

On Wed, May 6, 2015 at 3:37 PM, Yves Dorfsman <yves@zioup.com
<mailto:yves@zioup.com>>wrote:

On 9.3, is there any way to start a query, detach from the
server and have the
query keep going (long query that updates tables, but nothing
is returned)?

​ No. Sessions require an external client to maintain its connection.

David J.

--
*Melvin Davidson*
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.