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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user