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 1qvkiX-0078UH-IY for pgsql-sql@arkaria.postgresql.org; Wed, 25 Oct 2023 20:43:05 +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 1qvkiW-008Ii0-4T for pgsql-sql@arkaria.postgresql.org; Wed, 25 Oct 2023 20:43:04 +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 1qvkiV-008Ihs-S4 for pgsql-sql@lists.postgresql.org; Wed, 25 Oct 2023 20:43:03 +0000 Received: from mail-oo1-xc33.google.com ([2607:f8b0:4864:20::c33]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qvkiT-002IVG-9i for pgsql-sql@lists.postgresql.org; Wed, 25 Oct 2023 20:43:02 +0000 Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-5844bc378feso140426eaf.0 for ; Wed, 25 Oct 2023 13:43:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698266580; x=1698871380; 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=ZDuyEq7uarIBUAhAIrjjrziFA08hpZAxGorLLI7zQhE=; b=RosxAQGt25NzRZ6itSQFDyvlg4GfQGPWxPUR2tm1J6td0pOgRiV9g4LH0iJEoUBmUq 2UgD1b1cZzdeOqMp1AUc65eF5RLxSIdHIVL1iwpJFOKlO9do5JZjG/M/XsCjP2iSEZms HuNMHhHUCikwK1Pq4F9jucFcovo9+kjEiCuFpzU/1Owi5xdL5JrYxfHfedGRbha+kPAl 2F4DLmQM0rIG9Uw8zNCZ099lkyzE7jWo4JyI+rkJ9GyATOnK4j8k9PzdRhSlnb9DQ+Pi G7KQtPdDwVNX3jbwRztig/89UOWgT6yBsqtTIk4rLiHGGLpPK0eL1I8lzjm96gEHhJQA dmjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698266580; x=1698871380; 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=ZDuyEq7uarIBUAhAIrjjrziFA08hpZAxGorLLI7zQhE=; b=ed1EEgVycO44hL7IznwljKXqnKSFHrJzjfhoUOmGKuWbIN/VIkgiuhF5bHIT6Q3CHX 2Z6LSA+a9FN201PuEnxHdTSOkzAFTAGa+OM4ES3yNdCCLY34U+6kjNlO7dGg28fEH4mu TfJikrxIa40jc7RmDVk1TfFTAHJSQzxnQfyqHD2+1VF8agDxPZaILJ3Ep/brdQMLHY0w Ph5GlZZDbsQCr9Nb3BEh2MM2zOiogcTyy3WSWi/gL90ybXvfCpMW4fLXd2ui2Yh7XPuP k7kdS7pu+cnaN5b7aasx7uhT3obkI3mrr87LlIMfp/6zRPSe0IsiJYbsEXz1/xufbeOF eXiA== X-Gm-Message-State: AOJu0YwLz5HmvafQlVvs70G/Nh5SNYFaDa2rWNrRoXbNFNiWom6Uyshz UjAD2lVbZ1WRAaPI7ZiKj+py4H0eEc3l9tUMpLs= X-Google-Smtp-Source: AGHT+IEzntYUXdad8UBmZynRGXfBgVn5YfUbtsHoT0u+9PfVwDNMjjl6DjxOFfjSaM2MaUf3kL8UgzJfPraGQdy+Eq0= X-Received: by 2002:a4a:d84b:0:b0:57d:e5e7:6d00 with SMTP id g11-20020a4ad84b000000b0057de5e76d00mr16815192oov.6.1698266580641; Wed, 25 Oct 2023 13:43:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: hector vass Date: Wed, 25 Oct 2023 21:42:50 +0100 Message-ID: Subject: Re: Concurrently run scipts To: Bruce Momjian Cc: Shaozhong SHI , pgsql-sql Content-Type: multipart/alternative; boundary="00000000000045edaa06089080e7" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000045edaa06089080e7 Content-Type: text/plain; charset="UTF-8" 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. > > > --00000000000045edaa06089080e7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Concurrently but independently=C2=A0
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=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.


--00000000000045edaa06089080e7--