| From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
|---|---|
| To: | Rich Shepard <rshepard(at)appl-ecosys(dot)com> |
| Cc: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: Using psql's \prompt command |
| Date: | 2025-01-30 22:46:26 |
| Message-ID: | CAKFQuwYZs0zuUhNO37ToOUVuAyjsJ91U_Fw=2ouBrHcmQ8UHLg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Thu, Jan 30, 2025 at 3:44 PM David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> On Thu, Jan 30, 2025 at 3:38 PM Rich Shepard <rshepard(at)appl-ecosys(dot)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
>> 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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David G. Johnston | 2025-01-30 22:47:45 | Re: Using psql's \prompt command |
| Previous Message | David G. Johnston | 2025-01-30 22:44:20 | Re: Using psql's \prompt command |