Search Postgresql Archives

Re: Using psql's \prompt command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux