Thread: BUG #18061: The psql -v variable option does not work for the -c command option
BUG #18061: The psql -v variable option does not work for the -c command option
From
PG Bug reporting form
Date:
The following bug has been logged on the website: 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;"
Re: BUG #18061: The psql -v variable option does not work for the -c command option
From
"David G. Johnston"
Date:
On Sun, Aug 20, 2023 at 8:56 AM PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:
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.
David J.
Re: BUG #18061: The psql -v variable option does not work for the -c command option
From
Robert Greene
Date:
Rats
From: David G. Johnston <david.g.johnston@gmail.com>
Sent: Sunday, August 20, 2023 11:58:01 AM
To: robertmccollistergreene@hotmail.com <robertmccollistergreene@hotmail.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #18061: The psql -v variable option does not work for the -c command option
Sent: Sunday, August 20, 2023 11:58:01 AM
To: robertmccollistergreene@hotmail.com <robertmccollistergreene@hotmail.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #18061: The psql -v variable option does not work for the -c command option
On Sun, Aug 20, 2023 at 8:56 AM PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:
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.
David J.