agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedsend query in background
3+ messages / 3 participants
[nested] [flat]
* send query in background
@ 2020-10-09 04:31 Franz Timmer <ftimmer@ft-c.de>
0 siblings, 0 replies; 3+ messages in thread
From: Franz Timmer @ 2020-10-09 04:31 UTC (permalink / raw)
To: pgsql-sql@lists.postgresql.org
hallo,
I have one pg function (a long running sql query), it is running few
minutes. I start it from webserver via PHP.
My question: Is there a possibility, that this function runs in
background. PG send back a immidiately return and do the work after this
answer.
like linux/bash commands with an ampersand "&" at the and of the line.
The user get a prompt and can prozess his work.
When the user push the button on the website to start the sql-script, he
can process his work.
I work with v11.8, but it is possible to update to v12.
(google found some answers, but these a 10 years old)
Franz
^ permalink raw reply [nested|flat] 3+ messages in thread
* send query in background
@ 2020-10-09 04:34 ml@ft-c.de
2020-10-09 04:40 ` Re: send query in background Tatsuo Ishii <ishii@sraoss.co.jp>
0 siblings, 1 reply; 3+ messages in thread
From: ml@ft-c.de @ 2020-10-09 04:34 UTC (permalink / raw)
To: pgsql-sql@lists.postgresql.org
hallo,
I have one pg function (a long running sql query), it is running few
minutes. I start it from webserver via PHP.
My question: Is there a possibility, that this function runs in
background. PG send back a immidiately return and do the work after this
answer.
like linux/bash commands with an ampersand "&" at the and of the line.
The user get a prompt and can prozess his work.
When the user push the button on the website to start the sql-script, he
can process his work.
I work with v11.8, but it is possible to update to v12.
(google found some answers, but these a 10 years old)
Franz
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: send query in background
2020-10-09 04:34 send query in background ml@ft-c.de
@ 2020-10-09 04:40 ` Tatsuo Ishii <ishii@sraoss.co.jp>
0 siblings, 0 replies; 3+ messages in thread
From: Tatsuo Ishii @ 2020-10-09 04:40 UTC (permalink / raw)
To: ml@ft-c.de; +Cc: pgsql-sql@lists.postgresql.org
> I have one pg function (a long running sql query), it is running few
> minutes. I start it from webserver via PHP.
>
> My question: Is there a possibility, that this function runs in
> background. PG send back a immidiately return and do the work after
> this answer.
>
> like linux/bash commands with an ampersand "&" at the and of the
> line. The user get a prompt and can prozess his work.
>
> When the user push the button on the website to start the sql-script,
> he can process his work.
>
> I work with v11.8, but it is possible to update to v12.
> (google found some answers, but these a 10 years old)
>
You can use pg_send_query() of PHP.
Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2020-10-09 04:40 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09 04:31 send query in background Franz Timmer <ftimmer@ft-c.de>
2020-10-09 04:34 send query in background ml@ft-c.de
2020-10-09 04:40 ` Tatsuo Ishii <ishii@sraoss.co.jp>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox