Postgres引用了宏语法错误

问题描述 投票:0回答:1

试图使用带引号的psql SET值:

 $ psql db_name -v x=y
 => select :x;
 ERROR: column "y" does not exist # this is correct and expected
  => select UPPER(:'x');
 ERROR:  syntax error at or near ":"
 LINE 1: select UPPER(:'x');

最后一个查询应该返回

  upper
----------
 Y
(1 row)

但不是在一个盒子而不是另一个盒子? (不确定这种SET值使用的是什么)。

postgresql psql
1个回答
0
投票

结果我的客户端版本很旧:

# psql --version
psql (PostgreSQL) 8.4.20
contains support for command-line editing

需要9.x客户端版本。讨厌的旧发行版:

© www.soinside.com 2019 - 2024. All rights reserved.