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 1qvvJ9-008Z6F-KM for pgsql-sql@arkaria.postgresql.org; Thu, 26 Oct 2023 08:01:35 +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 1qvvJ7-00EJUX-Ul for pgsql-sql@arkaria.postgresql.org; Thu, 26 Oct 2023 08:01:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qvvJ7-00EJUP-M2 for pgsql-sql@lists.postgresql.org; Thu, 26 Oct 2023 08:01:33 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qvvJ2-002t4x-BM for pgsql-sql@lists.postgresql.org; Thu, 26 Oct 2023 08:01:33 +0000 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-9ad8a822508so96206766b.0 for ; Thu, 26 Oct 2023 01:01:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698307286; x=1698912086; 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=5wNQbr7aCvF+loB52BDCSer47grXv6MBI+nnvypTCIc=; b=LLReWux0awrRbAQy9VJhRLMh0holLRysoUsERVl5q0vlAgLajuslVXgTraFtHxNpU+ H1p1vN92+otDwCdz1zOp9iTr1O71FzkkT3BMz+P2Kjo/Pbbv9EYOlr6wfKN9tsUarRL1 0NGNk9RW8voVcxWjP/akZBshWEdjqEiVmCdPyThd9xih0VFuiS44AnkBu7kyGrones1R PRfAC2k+dW2SZ8aYoqfPP+psHen9TmHA6midMk6EcRIGS0aC9Tk17YFVZwoo8K5s3JXC FvrkuoXSeLMQ9XxfE4eZewzMQBlxS09T6FIlZZQ3UGjHUsBlCdQgaJTDfyYcHNP+0zDP suCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698307286; x=1698912086; 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=5wNQbr7aCvF+loB52BDCSer47grXv6MBI+nnvypTCIc=; b=n5lrARHlelQENqL1f2a51L4bgvysZDPxup1ebejfRFhWuwngXcsgOtsw7fOsRblPEY An98p//uikt5TDT+sgPK7C9vZnu77llkcTfpZkPghiL/vxHMt3DAFkg1lgbQe3EA2AtC znI+O7zIfknyRV0SOWzCo4S25jovIQMHC+ITKgC571HSe5K4GPvVxWVpvFHCza2BZCTZ vnJlypghXPCe11/INvCCtPHn9YjkDuR7HXQ6hWc8eTvpX/ldgIKhVsnPj6wdsfWHCJil EZRGW/M/QFRlZeqzr7OqtSmcBgBOgHB7b87ulyJ4+ehhk8NBbdD3fKZPwZTsPHnMf9SQ 46ow== X-Gm-Message-State: AOJu0YyDfFfeZc7gUedhVL+FqpNkzjW+f0+pgsKoOxMjhGEpLnjfigno GTP7jD0Sh1eQjvJWW3AHfbMBQJmZ2bEXsr+Trv8= X-Google-Smtp-Source: AGHT+IGNan/iHbilk7s8yj95Epp+Qux4gRMZnfcIIkDWeMpenZmlWEMxtyYs94vSk2ZWsK8P50cRSCmA0rTzbCE5iPg= X-Received: by 2002:a17:906:c104:b0:9ad:7890:b4c0 with SMTP id do4-20020a170906c10400b009ad7890b4c0mr13272265ejc.56.1698307286162; Thu, 26 Oct 2023 01:01:26 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Shaozhong SHI Date: Thu, 26 Oct 2023 09:01:14 +0100 Message-ID: Subject: Re: Concurrently run scipts To: hector vass Cc: Bruce Momjian , pgsql-sql Content-Type: multipart/alternative; boundary="00000000000082e1ab060899faa7" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000082e1ab060899faa7 Content-Type: text/plain; charset="UTF-8" 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. >> >> >> --00000000000082e1ab060899faa7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
How many scripts can be run concurrently but independ= ently?

Regards,

David
On W= ed, 25 Oct 2023 at 21:43, hector vass <hector.vass@gmail.com> wrote:
Concurrently but indepe= ndently=C2=A0
psql -f script1 & psql -f script2 = && fg
Similar in windows can be achieved usi= ng start iirc

On Wed, 25 Oct 2023, 21:15 Bruce Momjian, <bruce@momjian.us> w= rote:
On Wed, Oc= t 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://mom= jian.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.


--00000000000082e1ab060899faa7--