在PostreSQL 8.3中,我试图创建一个视图,该视图看起来就像一个现有表,但是具有不同的列名。
这有效
CREATE OR REPLACE VIEW gfam.nice_builds AS
SELECT (family_tree.family_tree_id) as x,
family_tree.family_tree_name, family_tree.family_tree_description
FROM gfam.family_tree;
上面复制了family_tree表,但是以下尝试失败:
CREATE OR REPLACE VIEW gfam.nice_builds AS
SELECT (family_tree.family_tree_id) as x,
family_tree.family_tree_name, family_tree.family_tree_description
FROM gfam.family_tree;
- 错误:无法更改视图列“ family_tree_id”的名称
如何重命名列?