I just realized that internal does not mean a variable defined in postgresql.conf.
So I can use \prompt
\prompt 'Please, enter an username ', my_user SELECT * FROM mY_users WHERE username = :my_user; \echo 'End of script'
EDIT
Like the \ echo command, you do not need to add ; In the end. In fact, if you add it when using \prompt , you will get an error message.
You can show the value read from stdin.
\echo 'Here\ the value read from stdin : ' :my_user
Luc m source share