Department of second thoughts: further experimentation with CREATE OR REPLACE

VIEW suggests that it'd be worth spelling the error messages out in a little
more detail.  This seems to help with localizing the problem.
This commit is contained in:
Tom Lane
2008-12-16 00:56:12 +00:00
parent 1b92aeb93e
commit 794ec7b063
2 changed files with 14 additions and 8 deletions

View File

@ -53,11 +53,11 @@ ERROR: cannot drop columns from view
-- should fail
CREATE OR REPLACE VIEW viewtest AS
SELECT 1, * FROM viewtest_tbl;
ERROR: cannot change name of view column "a"
ERROR: cannot change name of view column "a" to "?column?"
-- should fail
CREATE OR REPLACE VIEW viewtest AS
SELECT a, b::numeric FROM viewtest_tbl;
ERROR: cannot change data type of view column "b"
ERROR: cannot change data type of view column "b" from integer to numeric
-- should work
CREATE OR REPLACE VIEW viewtest AS
SELECT a, b, 0 AS c FROM viewtest_tbl;