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 1t8v2r-006juK-9Y for pgsql-admin@arkaria.postgresql.org; Thu, 07 Nov 2024 05:27:00 +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 1t8v2o-00C4Nj-MB for pgsql-admin@arkaria.postgresql.org; Thu, 07 Nov 2024 05:26:59 +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 1t8v2o-00C4Nb-Ae for pgsql-admin@lists.postgresql.org; Thu, 07 Nov 2024 05:26:58 +0000 Received: from mail-oa1-x32.google.com ([2001:4860:4864:20::32]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1t8v2l-000cwE-54 for pgsql-admin@lists.postgresql.org; Thu, 07 Nov 2024 05:26:58 +0000 Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-288642376bcso316593fac.1 for ; Wed, 06 Nov 2024 21:26:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730957214; x=1731562014; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=PgU56dd1PVpesFOdvov7sRoILKfRCwGjIZS7mR7sKg4=; b=UlFjr7w+bC+5FViz06Z3o6XHDfMG9VGPmlsdlQMFvrmz8RvAT7Su1ed2OEONgfySqQ vnEjAJWFUWU9XjNItM6XqwZ1kqATrxJ6DGytqA3UX9iU8sJMvq9X6hnZgr2WuyFCVXdT ht2HEMRc7sFZh1WtaKP35yyY+OrIC/Dp8n8a+Aa8P6gf/bTPk7v3aH5eCg7ENGRIWzHH 61CkdRr5fDAEIzjBQWXjVsvLyQYNgfb4w29p+pCyyCANBzSQ/J1m2rxKhyY1c1N2SGIa vS2T53LksRww2o+mmTIvWsXZTnYAhlXgZtLphwBo61yTwREvBocu2vuL8rYbMoFI4IXl V5Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730957214; x=1731562014; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PgU56dd1PVpesFOdvov7sRoILKfRCwGjIZS7mR7sKg4=; b=W9bqanAsFRBa4jQuPkuef3KApgufriA311Dsyv6AD4r4sUpfzASHYHPoiT+UhQi4/K njxIbTB8QLfC8Ku7dvzTx14C1dLV1xMVI37o00DCNHxazvzVYpoTcrmGBlnyUFsOQY6c heyqM+tBrMBPAlRwSYwGcZcf5o8qi75inU7gfl15SZjJsSY4JHcN6ueXnmZsdCIyVFYx DYVSML+RtBXjgG8CWWosctIBGOP5p0md8QEnVxlj/BZs7Vs0xkuU3oivOvITJMLueRO4 Uub0RkiV59vwZVpinnnawcFxDWs9vKRvibKiqQ9oUFg8CUiQwg0YhWlRJ6cv/VvM0u0X zBTQ== X-Gm-Message-State: AOJu0YxP/WqTXwmMvzTqdUjWWyyE68+7XsWz1fUWt8XehCC/YR9VJk0A +H00wzVsYOWvcNG77oJenLYBlUK8BJx8nGxkimN4ELP35ryNu0EQ6mOy5waxKiJOOMYvnQmEA5u GK075FHzoT3GNBKY3QioVK9D0EPsQ1w== X-Google-Smtp-Source: AGHT+IFOjVYMcG/3Bf5LnXrtWEKo62LaMsL8MXFQPBDIb5S/G/u9Z5592bgA+dxclbCF9Nfo1Oo1NUGMQjJZB1FjUDE= X-Received: by 2002:a05:6870:e243:b0:27b:66ea:add7 with SMTP id 586e51a60fabf-2949ed2a775mr19495340fac.4.1730957214213; Wed, 06 Nov 2024 21:26:54 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a05:6802:27c2:b0:56c:c9af:3ee6 with HTTP; Wed, 6 Nov 2024 21:26:53 -0800 (PST) In-Reply-To: References: From: "David G. Johnston" Date: Wed, 6 Nov 2024 22:26:53 -0700 Message-ID: Subject: Re: \i and \watch To: Edwin UY Cc: "pgsql-admin@lists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000e0008906264be17a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000e0008906264be17a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wednesday, November 6, 2024, Edwin UY wrote: > > Is there no way to use \watch to let it run the last script that I just > run? > > When do I do as below: > > select 1 ; > \i x.sql > \watch 20 > > It runs select 1 instead. > > Watch is documented to act on either a non-empty query buffer or the last sent command. I would expect that whatever the final SQL command present in x.sql is would be the command that gets watched. If indeed the preceding select 1 command is watched there would seem to be an undocumented interaction going on. In any case, no, you cannot watch a meta-command. You=E2=80=99d have to re= sort to shell scripting the repeated execution of the psql program itself. David J. --000000000000e0008906264be17a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wednesday, November 6, 2024, Edwin UY <edwin.uy@gmail.com> wrote:

Is there no way to use \watch to let = it run the last script that I just run?

When do I = do as below:

select 1 ;
\i x.sql
\watch 20

It runs select 1 instead.
<= br>

Watch is documented to act = on either a non-empty query buffer or the last sent command.=C2=A0 I would = expect that whatever the final SQL command present in x.sql is would be the= command that gets watched.=C2=A0 If indeed the preceding select 1 command = is watched there would seem to be an undocumented interaction going on.

In any case, no, you cannot watch a meta-command.=C2= =A0 You=E2=80=99d have to resort to shell scripting the repeated execution = of the psql program itself.

David J.
--000000000000e0008906264be17a--