我的PostgreSQL 10.1数据库中有以下表格:
Table "public.master_plan"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
----------------------+------+-----------+----------+---------+----------+--------------+-------------
start_time_utc | text | | | | extended | |
duration | text | | | | extended | |
date | text | | | | extended | |
team | text | | | | extended | |
spass_type | text | | | | extended | |
target | text | | | | extended | |
request_name | text | | | | extended | |
library_definition | text | | | | extended | |
title | text | | | | extended | |
description | text | | | | extended | |
当我尝试以下sql查询时:
select title from master_plan;
它返回以下错误:
ERROR: column "title" does not exist
LINE 1: select title from master_plan;
^
HINT: Perhaps you meant to reference the column "master_plan. title".
我做错了什么?这应该有用......
答案 0 :(得分:0)
名称中有空格。试试这个:
alter table master_plan rename column " title" to title;
select title from master_plan;
或
alter table master_plan rename column "master_plan. title" to title;
select title from master_plan;
您可以在以下位置查看正在运行的示例:http://rextester.com/LCXW46910