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 1tddHP-008bEo-TW for pgsql-general@arkaria.postgresql.org; Thu, 30 Jan 2025 22:45: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 1tddHP-00DpAl-0G for pgsql-general@arkaria.postgresql.org; Thu, 30 Jan 2025 22:44:59 +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 1tddHO-00DpAd-Kh for pgsql-general@lists.postgresql.org; Thu, 30 Jan 2025 22:44:58 +0000 Received: from mail-oa1-x33.google.com ([2001:4860:4864:20::33]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tddHM-002MhR-1i for pgsql-general@postgresql.org; Thu, 30 Jan 2025 22:44:57 +0000 Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-2addd5053c0so710825fac.1 for ; Thu, 30 Jan 2025 14:44:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738277096; x=1738881896; darn=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=kU5CGWQgFmr9LgE6+UFtg2tJfa8ad63BzyeXJdWXqJ0=; b=lj2OpwEuJ+JmWANQSMhbJRkmuCrFUcPGBWwC1uLv+ZbQAyr+mGscxOj4ioc5vuUSIu Tic5X9CEeZHU6Lz1vfquVQpQfNSUHZKRAV1DWbtYBj93C/Zq2j5l9VizZj61v477S5LF dBH575Gvx5rhSQfMBaLP76VeJn25D3dxhFBzNMXGSzapAajQQp4HsRGbGlunLuIZKdVe SRG12bUla4FQIFpWIFUO57njlxII1cxKjecvWkgf7svcr1csyFQzOK1I7Q3S/zWA6awT kKBVwedpgt6A1UD4vCbSHi2TGi4xXXhZ/6mUQCpNn63jDs82zIQ9K40pvr8YWnwtMG0p sacQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738277096; x=1738881896; 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=kU5CGWQgFmr9LgE6+UFtg2tJfa8ad63BzyeXJdWXqJ0=; b=qqRsmt4Hb1TKUBxcMKcdihSCCHdz0yF3LkTILOOQkGG+/B20xkFk82cdknT9mAWHR4 UIROtWiC0ZdhScqCd0cB1qe6/fWyeVWolNffuehl69r0A4RjcazXMNkdGWStJuZWAenI d7cdsWs6OHxT08iX6eBwraHNguR9iz0OMFyuXhat9qb2oXCwo2mCuLtjgCnbkiylDfpC NAH+2dRlAYD58ujyzfTiaGxXcLUcjj4VIgAfLvYLNMj6ZbUBwBnVJogiesvnH6aX7C8+ rWO3M6GvXcAR+m0aAXzBMHaf9Wf2U3lQ0f+bNP7N8lS/b7NxuWEUjPItX2AEVQHCwDc4 E0mg== X-Gm-Message-State: AOJu0YwltumZ/6ffs/P3omi/Cj+tshPbDiyecaEToK0HE1iQpPfK0jqn pXLqrseuWOwQ636nBDnnMzlOZtZZBnqsVB8+xbEtSxwkZqxd/J0KzDFZKTr9StiwjTr7KCLNz7P YIfbS7W+xgeJxFMmmq7v5wUxglfsEww== X-Gm-Gg: ASbGncvRKzPnVre22AS3Af2YTRHlav44HcMMa8UqzQfbWgZBNbWE4exVKthN9mQzgpm Q/5oVPJFqZestqFwt2D0iUfrUsraco0hIxp0FZ9k2qdrdlkvqTVmBjZ54JvH+ww+S1/kRTYY= X-Google-Smtp-Source: AGHT+IERlzqwrGulOHe+z997Y8jff+sWnpuIv4hmK2Lhe94HYO/n+2Wtrm2pZJkf220MeF2rOkFvbvQkqSYGOFfxutc= X-Received: by 2002:a05:6870:6b8e:b0:29e:49b3:c527 with SMTP id 586e51a60fabf-2b32f3c2628mr5448962fac.24.1738277096441; Thu, 30 Jan 2025 14:44:56 -0800 (PST) MIME-Version: 1.0 References: <1dbc1ace-c119-6ed2-d579-561525f3bf0@appl-ecosys.com> <28334f3d-5942-4849-374f-32f2f6a4e9c@appl-ecosys.com> <69ead979-7c20-d246-b52f-3e7af585da3d@appl-ecosys.com> In-Reply-To: <69ead979-7c20-d246-b52f-3e7af585da3d@appl-ecosys.com> From: "David G. Johnston" Date: Thu, 30 Jan 2025 15:44:20 -0700 X-Gm-Features: AWEUYZmjht_f1d810W7GgMvS0p3_Qw-m3QFcBDXf80GvQIQrbF-Y_Xma-jmqWkw Message-ID: Subject: Re: Using psql's \prompt command To: Rich Shepard Cc: "pgsql-general@postgresql.org" Content-Type: multipart/alternative; boundary="000000000000dacc5a062cf42caa" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000dacc5a062cf42caa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jan 30, 2025 at 3:38=E2=80=AFPM Rich Shepard wrote: > On Thu, 30 Jan 2025, Rich Shepard wrote: > > > Thank you. I'll look into using the \set command. > > My web searches find many examples of using the \set command, but none > getting user input with \prompt. > > Please point me to a reference where I can learn how to get the user inpu= t > string into the script. > That is what \prompt is for. You have the correct meta-command, you were capturing user input just fine. Read about how to use variables in queries for the part you are missing. David J. --000000000000dacc5a062cf42caa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Jan 30, 2025 at 3:38=E2=80=AFPM Rich Shepard <<= a href=3D"mailto:rshepard@appl-ecosys.com">rshepard@appl-ecosys.com>= wrote:
=
On Thu, 30 Jan 2025, Rich= Shepard wrote:

> Thank you. I'll look into using the \set command.

My web searches find many examples of using the \set command, but none
getting user input with \prompt.

Please point me to a reference where I can learn how to get the user input<= br> string into the script.

That is what \prompt is for.=C2=A0 You have= =C2=A0the correct meta-command, you were capturing user input just fine.=C2= =A0 Read about how=C2=A0to use variables in queries for the part you are mi= ssing.

David J.
--000000000000dacc5a062cf42caa--