| From: | hubert depesz lubaczewski <depesz(at)depesz(dot)com> |
|---|---|
| To: | Rich Shepard <rshepard(at)appl-ecosys(dot)com> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Using psql's \prompt command |
| Date: | 2025-01-31 13:12:07 |
| Message-ID: | Z5zMJ7cFdv2LyEbl@depesz.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Thu, Jan 30, 2025 at 01:47:59PM -0800, Rich Shepard wrote:
> # \i person_view.sql
> Enter person_nbr: 468
> psql:person_view.sql:9: ERROR: column "store" does not exist
> LINE 3: where person_nbr = store
> ^
> What's the correct syntax for the \prompt?
prompt is ok.
but you can't just throw variable name in the query and assume it will
get substituted.
the proper syntax is :store, or (better) :'store'
and again: not in the *\prompt* line - in the place where you use it.
You might want to read
https://www.depesz.com/2023/05/28/variables-in-psql-how-to-use-them/
Best regards,
depesz
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Laurenz Albe | 2025-01-31 13:30:01 | Re: Postgres restore sometimes restores to a point 2 days in the past |
| Previous Message | Koen De Groote | 2025-01-31 09:47:17 | Postgres restore sometimes restores to a point 2 days in the past |