Bug reference: 18061 Logged by: Robert Greene Email address: robertmccollistergreene@hotmail.com PostgreSQL version: 15.4 Operating system: Windows, Linux Description:
psql -v v1=1 -c "select col from table where colname=:v1;"
Yes, since psql variables are not parsable by the server the following sentence in the documentation for -c explains your observation:
> command must be either a command string that is completely parsable by the server (i.e., it contains no psql-specific features), or a single backslash command.