Thread: Concurrently run scipts

Concurrently run scipts

From
Shaozhong SHI
Date:
In psql  we run scripts sequentially like the following:

\ir script1
\ir script2


Is there something similar for concurrent running script?

Regards,

David

Re: Concurrently run scipts

From
Bruce Momjian
Date:
On Wed, Oct 25, 2023 at 08:57:03PM +0100, Shaozhong SHI wrote:
> In psql  we run scripts sequentially like the following:
> 
> \ir script1
> \ir script2
> 
> 
> Is there something similar for concurrent running script?

Uh, yeah, see the use of \! and & starting on slide 59:

    https://momjian.us/main/writings/pgsql/locking.pdf

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.



Re: Concurrently run scipts

From
hector vass
Date:
Concurrently but independently 
psql -f script1 & psql -f script2 && fg
Similar in windows can be achieved using start iirc

On Wed, 25 Oct 2023, 21:15 Bruce Momjian, <bruce@momjian.us> wrote:
On Wed, Oct 25, 2023 at 08:57:03PM +0100, Shaozhong SHI wrote:
> In psql  we run scripts sequentially like the following:
>
> \ir script1
> \ir script2
>
>
> Is there something similar for concurrent running script?

Uh, yeah, see the use of \! and & starting on slide 59:

        https://momjian.us/main/writings/pgsql/locking.pdf

--
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.


Re: Concurrently run scipts

From
Shaozhong SHI
Date:
How many scripts can be run concurrently but independently?

Regards,

David

On Wed, 25 Oct 2023 at 21:43, hector vass <hector.vass@gmail.com> wrote:
Concurrently but independently 
psql -f script1 & psql -f script2 && fg
Similar in windows can be achieved using start iirc

On Wed, 25 Oct 2023, 21:15 Bruce Momjian, <bruce@momjian.us> wrote:
On Wed, Oct 25, 2023 at 08:57:03PM +0100, Shaozhong SHI wrote:
> In psql  we run scripts sequentially like the following:
>
> \ir script1
> \ir script2
>
>
> Is there something similar for concurrent running script?

Uh, yeah, see the use of \! and & starting on slide 59:

        https://momjian.us/main/writings/pgsql/locking.pdf

--
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.


Re: Concurrently run scipts

From
hector vass
Date:
max_connections

..which is set in postgresql.conf
select * from pg_settings() where setting~'conn'




On Thu, 26 Oct 2023, 09:01 Shaozhong SHI, <shishaozhong@gmail.com> wrote:
How many scripts can be run concurrently but independently?

Regards,

David

On Wed, 25 Oct 2023 at 21:43, hector vass <hector.vass@gmail.com> wrote:
Concurrently but independently 
psql -f script1 & psql -f script2 && fg
Similar in windows can be achieved using start iirc

On Wed, 25 Oct 2023, 21:15 Bruce Momjian, <bruce@momjian.us> wrote:
On Wed, Oct 25, 2023 at 08:57:03PM +0100, Shaozhong SHI wrote:
> In psql  we run scripts sequentially like the following:
>
> \ir script1
> \ir script2
>
>
> Is there something similar for concurrent running script?

Uh, yeah, see the use of \! and & starting on slide 59:

        https://momjian.us/main/writings/pgsql/locking.pdf

--
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.


Re: Concurrently run scipts

From
Shaozhong SHI
Date:
Thanks.  I am aware of that concurrent running of scripts can be done in Linux.

But, my users prefer to run these in PgAdmin.  Can such concurrent run be automated in PgAmin?

Regards,  David

On Thu, 26 Oct 2023 at 10:21, hector vass <hector.vass@gmail.com> wrote:
max_connections

..which is set in postgresql.conf
select * from pg_settings() where setting~'conn'




On Thu, 26 Oct 2023, 09:01 Shaozhong SHI, <shishaozhong@gmail.com> wrote:
How many scripts can be run concurrently but independently?

Regards,

David

On Wed, 25 Oct 2023 at 21:43, hector vass <hector.vass@gmail.com> wrote:
Concurrently but independently 
psql -f script1 & psql -f script2 && fg
Similar in windows can be achieved using start iirc

On Wed, 25 Oct 2023, 21:15 Bruce Momjian, <bruce@momjian.us> wrote:
On Wed, Oct 25, 2023 at 08:57:03PM +0100, Shaozhong SHI wrote:
> In psql  we run scripts sequentially like the following:
>
> \ir script1
> \ir script2
>
>
> Is there something similar for concurrent running script?

Uh, yeah, see the use of \! and & starting on slide 59:

        https://momjian.us/main/writings/pgsql/locking.pdf

--
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.


Re: Concurrently run scipts

From
hector vass
Date:
Sorry no idea, pgadmin is a web app front end to postgresql so there may be a more appropriate mailing list to ask on than pgsql-sql

On Thu, 26 Oct 2023, 10:49 Shaozhong SHI, <shishaozhong@gmail.com> wrote:
Thanks.  I am aware of that concurrent running of scripts can be done in Linux.

But, my users prefer to run these in PgAdmin.  Can such concurrent run be automated in PgAmin?

Regards,  David

On Thu, 26 Oct 2023 at 10:21, hector vass <hector.vass@gmail.com> wrote:
max_connections

..which is set in postgresql.conf
select * from pg_settings() where setting~'conn'




On Thu, 26 Oct 2023, 09:01 Shaozhong SHI, <shishaozhong@gmail.com> wrote:
How many scripts can be run concurrently but independently?

Regards,

David

On Wed, 25 Oct 2023 at 21:43, hector vass <hector.vass@gmail.com> wrote:
Concurrently but independently 
psql -f script1 & psql -f script2 && fg
Similar in windows can be achieved using start iirc

On Wed, 25 Oct 2023, 21:15 Bruce Momjian, <bruce@momjian.us> wrote:
On Wed, Oct 25, 2023 at 08:57:03PM +0100, Shaozhong SHI wrote:
> In psql  we run scripts sequentially like the following:
>
> \ir script1
> \ir script2
>
>
> Is there something similar for concurrent running script?

Uh, yeah, see the use of \! and & starting on slide 59:

        https://momjian.us/main/writings/pgsql/locking.pdf

--
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.