In PostreSQL 8.3, I'm trying to create a view which will look just like an existing table but have different column names.
This works
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;
The above makes a duplicate of the family_tree table but the following attempt fails:
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;
- ERROR: cannot change name of view column "family_tree_id"
How can I rename columns?