Re: Using psql's \prompt command

Поиск
Список
Период
Сортировка
От hubert depesz lubaczewski
Тема Re: Using psql's \prompt command
Дата
Msg-id Z5zMJ7cFdv2LyEbl@depesz.com
обсуждение исходный текст
Ответ на Using psql's \prompt command  (Rich Shepard <rshepard@appl-ecosys.com>)
Список 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




В списке pgsql-general по дате отправления: