public inbox for [email protected]  
help / color / mirror / Atom feed
From: David G. Johnston <[email protected]>
To: Rich Shepard <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Using psql's \prompt command
Date: Thu, 30 Jan 2025 15:46:26 -0700
Message-ID: <CAKFQuwYZs0zuUhNO37ToOUVuAyjsJ91U_Fw=2ouBrHcmQ8UHLg@mail.gmail.com> (raw)
In-Reply-To: <CAKFQuwYk1xeDbna0_6htbvUMptn=TK0rKN=5doOjNPCaQ3zjEA@mail.gmail.com>
References: <[email protected]>
	<CAKFQuwbBrjF6Hx3zOo1p7=+ui=qeoZiK46-=Ov8JC=5GqvPe2A@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<CAKFQuwYk1xeDbna0_6htbvUMptn=TK0rKN=5doOjNPCaQ3zjEA@mail.gmail.com>

On Thu, Jan 30, 2025 at 3:44 PM David G. Johnston <
[email protected]> wrote:

> On Thu, Jan 30, 2025 at 3:38 PM Rich Shepard <[email protected]>
> 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
>> 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.
>

Specifically the section of the psql docs titled:

SQL Interpolation

David J.


view thread (9+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Using psql's \prompt command
  In-Reply-To: <CAKFQuwYZs0zuUhNO37ToOUVuAyjsJ91U_Fw=2ouBrHcmQ8UHLg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox