Postgres引用宏语法错误

Postgres quoted macro syntax error

正在尝试使用带引号的 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');

最后一个查询应该 return

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

但一个盒子上没有,另一个盒子上没有? (不知道这种SET值指的是什么)

原来我的客户端版本是旧的:

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

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