Postgresql Postgres-转义列名中的问号(?)
我继承的Postgres DB中的一列名称中有一个问号 当我尝试选择它时,它会抛出一个错误Postgresql Postgres-转义列名中的问号(?),postgresql,escaping,Postgresql,Escaping,我继承的Postgres DB中的一列名称中有一个问号 当我尝试选择它时,它会抛出一个错误 > select confirmed? from user_purchases; ERROR: column "confirmed" does not exist LINE 1: select confirmed? from user_purchases; ^ HINT: Perhaps you meant to reference the column "use
> select confirmed? from user_purchases;
ERROR: column "confirmed" does not exist
LINE 1: select confirmed? from user_purchases;
^
HINT: Perhaps you meant to reference the column "user_purchases.confirmed?".
我也尝试过用倒勾(`confirm?`)和引号(`confirm?`)来选择它,但出现了相同的错误
如何选择此字段
谢谢 使用双引号:
select "confirmed?" from user_purchases;
谢谢!所以我尝试了这个方法,但没有成功,但我刚刚意识到我使用的是一个表别名,我在最初的问题中没有明确说明这一点。因此,对于使用表别名的其他任何人来说,都是
从user\u purchases up中选择“confirm?”
。