1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-07 12:02:30 +03:00

Department of second thoughts: make checks for replacing a view slightly

more flexible, and improve the error reporting.  Also, add documentation
for REPLACE RULE/VIEW.
This commit is contained in:
Tom Lane
2002-09-02 20:04:40 +00:00
parent b4d24d78a9
commit 8f60f43f2e
5 changed files with 84 additions and 24 deletions

View File

@@ -44,14 +44,14 @@ SELECT * FROM viewtest;
-- should fail
CREATE OR REPLACE VIEW viewtest AS
SELECT a FROM viewtest_tbl WHERE a <> 20;
ERROR: Cannot change column set of existing view viewtest
ERROR: Cannot change number of columns in view
-- should fail
CREATE OR REPLACE VIEW viewtest AS
SELECT 1, * FROM viewtest_tbl;
ERROR: Cannot change column set of existing view viewtest
ERROR: Cannot change number of columns in view
-- should fail
CREATE OR REPLACE VIEW viewtest AS
SELECT a, b::numeric FROM viewtest_tbl;
ERROR: Cannot change column set of existing view viewtest
ERROR: Cannot change datatype of view column "b"
DROP VIEW viewtest;
DROP TABLE viewtest_tbl;