Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qvwYh-008iQf-Kn for pgsql-sql@arkaria.postgresql.org; Thu, 26 Oct 2023 09:21:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qvwYg-00F6wM-73 for pgsql-sql@arkaria.postgresql.org; Thu, 26 Oct 2023 09:21:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qvwYf-00F6wE-UM for pgsql-sql@lists.postgresql.org; Thu, 26 Oct 2023 09:21:41 +0000 Received: from mail-oo1-xc2b.google.com ([2607:f8b0:4864:20::c2b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qvwYc-002NpO-AZ for pgsql-sql@lists.postgresql.org; Thu, 26 Oct 2023 09:21:40 +0000 Received: by mail-oo1-xc2b.google.com with SMTP id 006d021491bc7-581de3e691dso380717eaf.3 for ; Thu, 26 Oct 2023 02:21:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698312097; x=1698916897; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Ry8egXacWwejmh8m+FXiO6CE6yLyHLMksCRo9gno/7I=; b=Z9nIgoX2PidAS4s6KSUbSn0Igxtkk5iY8ftfHO4W0aXMl1aFEqJ0M1rUrOZeOtm6k/ oVQxc2meHlVEolSNoxXtMdEEvuJyoToArJRIZ6LybV7oXSkdA03GW/38XfZsPoSi3wOI K3RVMPL9vc3IB+laru+oR3OihD30IUF4tudjdcbeNT/eCV/Rp3b9Lc9JvrfoNtHU0zE0 amL/OyDUwrglnLjR0MY3EsGiF28RePuishV4OXrtJ+2qIOR4ePrQrAKgrjr3lXiHcL/o YnDigc3nOveoGctgYUVqyXpQiUVCo/qZH4VpdYCrNypChA8VoVEhFbtHljld4IXi/g6h g4uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698312097; x=1698916897; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ry8egXacWwejmh8m+FXiO6CE6yLyHLMksCRo9gno/7I=; b=wUyWePjn1lViwN4+3FUze2Rsvv4k2a22K84yEwKpfG1SD1gCLDU17FZa3yNdLGyVuS ednEt1GDyXCxU0hIYpwBv4WW3Taw8PR8FkIyn2Ii9ZihlsR2umSG9nRU6pKAvtNEH4aO KbTSroP/R5mo0Focsux4ceDZixTgWEHsZwDDpWei3vMTcz2ltlFaaTO5uFCv+cHW+mSA cw99k6tVI9G+mlpc9uTKzwudpq/dlXOUHA9hFdvF0GFbYV/JKwf5GIg8o0TfPLUJfrgw Ic7a+290LTkE8N2qKmtILJllOfUQQX86VgaZDzIsr6qLGVpN4YAqVFltLZEdBOrEu9xe 1E3g== X-Gm-Message-State: AOJu0YxGQUvx3+YASzM4+aQyZZDXBkOgoWK86irfG1pX6OdmpLcguNWE 5EZ3baPSoGeJEAo38/LmDuZAEQhYmE1QMxSISu0= X-Google-Smtp-Source: AGHT+IEQagqX5Zh62o9DbzUnBMWaHzXzHuvyzZFpjr4kinZMAqil9JiZ/q7x5rlKpiWAd+A+94fERTXXfiucFAeRr68= X-Received: by 2002:a4a:ca95:0:b0:57b:6ab1:87c9 with SMTP id x21-20020a4aca95000000b0057b6ab187c9mr18457010ooq.0.1698312097632; Thu, 26 Oct 2023 02:21:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: hector vass Date: Thu, 26 Oct 2023 10:21:26 +0100 Message-ID: Subject: Re: Concurrently run scipts To: Shaozhong SHI Cc: Bruce Momjian , pgsql-sql Content-Type: multipart/alternative; boundary="0000000000004c16ac06089b190a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004c16ac06089b190a Content-Type: text/plain; charset="UTF-8" max_connections ..which is set in postgresql.conf select * from pg_settings() where setting~'conn' On Thu, 26 Oct 2023, 09:01 Shaozhong SHI, wrote: > How many scripts can be run concurrently but independently? > > Regards, > > David > > On Wed, 25 Oct 2023 at 21:43, hector vass 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, 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 https://momjian.us >>> EDB https://enterprisedb.com >>> >>> Only you can decide what is important to you. >>> >>> >>> --0000000000004c16ac06089b190a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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=C2=A0
psql -f script1 & psql = -f script2 && fg
Similar in windows can be a= chieved 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=C2=A0 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:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 = https://momjian.us/main/writings/pgsql/locking.pdf

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

=C2=A0 Only you can decide what is important to you.


--0000000000004c16ac06089b190a--