diff --git a/src/postgres/contrib/postgres_fdw/expected/yb_pg_postgres_fdw.out b/src/postgres/contrib/postgres_fdw/expected/yb_pg_postgres_fdw.out index c33c3f04b1da..69a518b2fdbb 100644 --- a/src/postgres/contrib/postgres_fdw/expected/yb_pg_postgres_fdw.out +++ b/src/postgres/contrib/postgres_fdw/expected/yb_pg_postgres_fdw.out @@ -2281,28 +2281,138 @@ GRANT SELECT ON ft4 TO regress_view_owner; GRANT SELECT ON ft5 TO regress_view_owner; CREATE VIEW v4 AS SELECT * FROM ft4; CREATE VIEW v5 AS SELECT * FROM ft5; --- YB note: ERROR: ALTER VIEW not supported yet, reenable commented out tests when issue #1131 is fixed ALTER VIEW v5 OWNER TO regress_view_owner; -ERROR: ALTER VIEW not supported yet -LINE 1: ALTER VIEW v5 OWNER TO regress_view_owner; - ^ -HINT: See https://github.com/yugabyte/yugabyte-db/issues/1131. React with thumbs up to raise its priority ---EXPLAIN (VERBOSE, COSTS OFF) ---SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can't be pushed down, different view owners ---SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; ---ALTER VIEW v4 OWNER TO regress_view_owner; ---EXPLAIN (VERBOSE, COSTS OFF) ---SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can be pushed down ---SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; --- ---EXPLAIN (VERBOSE, COSTS OFF) ---SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can't be pushed down, view owner not current user ---SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; ---ALTER VIEW v4 OWNER TO CURRENT_USER; ---EXPLAIN (VERBOSE, COSTS OFF) ---SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can be pushed down ---SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; ---ALTER VIEW v4 OWNER TO regress_view_owner; +EXPLAIN (VERBOSE, COSTS OFF) +SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can't be pushed down, different view owners + QUERY PLAN +---------------------------------------------------------------------- + Limit + Output: ft4.c1, ft5.c2, ft5.c1 + -> Sort + Output: ft4.c1, ft5.c2, ft5.c1 + Sort Key: ft4.c1, ft5.c1 + -> Hash Left Join + Output: ft4.c1, ft5.c2, ft5.c1 + Hash Cond: (ft4.c1 = ft5.c1) + -> Foreign Scan on public.ft4 + Output: ft4.c1, ft4.c2, ft4.c3 + Remote SQL: SELECT c1 FROM "S 1"."T 3" + -> Hash + Output: ft5.c2, ft5.c1 + -> Foreign Scan on public.ft5 + Output: ft5.c2, ft5.c1 + Remote SQL: SELECT c1, c2 FROM "S 1"."T 4" +(16 rows) + +SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; + c1 | c2 +----+---- + 22 | + 24 | 25 + 26 | + 28 | + 30 | 31 + 32 | + 34 | + 36 | 37 + 38 | + 40 | +(10 rows) + +ALTER VIEW v4 OWNER TO regress_view_owner; +EXPLAIN (VERBOSE, COSTS OFF) +SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can be pushed down + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Limit + Output: ft4.c1, ft5.c2, ft5.c1 + -> Foreign Scan + Output: ft4.c1, ft5.c2, ft5.c1 + Relations: (public.ft4) LEFT JOIN (public.ft5) + Remote SQL: SELECT r6.c1, r9.c2, r9.c1 FROM ("S 1"."T 3" r6 LEFT JOIN "S 1"."T 4" r9 ON (((r6.c1 = r9.c1)))) ORDER BY r6.c1 ASC NULLS LAST, r9.c1 ASC NULLS LAST +(6 rows) + +SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; + c1 | c2 +----+---- + 22 | + 24 | 25 + 26 | + 28 | + 30 | 31 + 32 | + 34 | + 36 | 37 + 38 | + 40 | +(10 rows) + +EXPLAIN (VERBOSE, COSTS OFF) +SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can't be pushed down, view owner not current user + QUERY PLAN +---------------------------------------------------------------------- + Limit + Output: ft4.c1, t2.c2, t2.c1 + -> Sort + Output: ft4.c1, t2.c2, t2.c1 + Sort Key: ft4.c1, t2.c1 + -> Hash Left Join + Output: ft4.c1, t2.c2, t2.c1 + Hash Cond: (ft4.c1 = t2.c1) + -> Foreign Scan on public.ft4 + Output: ft4.c1, ft4.c2, ft4.c3 + Remote SQL: SELECT c1 FROM "S 1"."T 3" + -> Hash + Output: t2.c2, t2.c1 + -> Foreign Scan on public.ft5 t2 + Output: t2.c2, t2.c1 + Remote SQL: SELECT c1, c2 FROM "S 1"."T 4" +(16 rows) + +SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; + c1 | c2 +----+---- + 22 | + 24 | 25 + 26 | + 28 | + 30 | 31 + 32 | + 34 | + 36 | 37 + 38 | + 40 | +(10 rows) + +ALTER VIEW v4 OWNER TO CURRENT_USER; +EXPLAIN (VERBOSE, COSTS OFF) +SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can be pushed down + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Limit + Output: ft4.c1, t2.c2, t2.c1 + -> Foreign Scan + Output: ft4.c1, t2.c2, t2.c1 + Relations: (public.ft4) LEFT JOIN (public.ft5 t2) + Remote SQL: SELECT r6.c1, r2.c2, r2.c1 FROM ("S 1"."T 3" r6 LEFT JOIN "S 1"."T 4" r2 ON (((r6.c1 = r2.c1)))) ORDER BY r6.c1 ASC NULLS LAST, r2.c1 ASC NULLS LAST +(6 rows) + +SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; + c1 | c2 +----+---- + 22 | + 24 | 25 + 26 | + 28 | + 30 | 31 + 32 | + 34 | + 36 | 37 + 38 | + 40 | +(10 rows) + +ALTER VIEW v4 OWNER TO regress_view_owner; -- cleanup DROP OWNED BY regress_view_owner; DROP ROLE regress_view_owner; diff --git a/src/postgres/contrib/postgres_fdw/sql/yb_pg_postgres_fdw.sql b/src/postgres/contrib/postgres_fdw/sql/yb_pg_postgres_fdw.sql index 77b4a9bf44e9..003059c5c176 100644 --- a/src/postgres/contrib/postgres_fdw/sql/yb_pg_postgres_fdw.sql +++ b/src/postgres/contrib/postgres_fdw/sql/yb_pg_postgres_fdw.sql @@ -600,24 +600,23 @@ GRANT SELECT ON ft5 TO regress_view_owner; CREATE VIEW v4 AS SELECT * FROM ft4; CREATE VIEW v5 AS SELECT * FROM ft5; --- YB note: ERROR: ALTER VIEW not supported yet, reenable commented out tests when issue #1131 is fixed ALTER VIEW v5 OWNER TO regress_view_owner; ---EXPLAIN (VERBOSE, COSTS OFF) ---SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can't be pushed down, different view owners ---SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; ---ALTER VIEW v4 OWNER TO regress_view_owner; ---EXPLAIN (VERBOSE, COSTS OFF) ---SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can be pushed down ---SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; --- ---EXPLAIN (VERBOSE, COSTS OFF) ---SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can't be pushed down, view owner not current user ---SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; ---ALTER VIEW v4 OWNER TO CURRENT_USER; ---EXPLAIN (VERBOSE, COSTS OFF) ---SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can be pushed down ---SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; ---ALTER VIEW v4 OWNER TO regress_view_owner; +EXPLAIN (VERBOSE, COSTS OFF) +SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can't be pushed down, different view owners +SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; +ALTER VIEW v4 OWNER TO regress_view_owner; +EXPLAIN (VERBOSE, COSTS OFF) +SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can be pushed down +SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; + +EXPLAIN (VERBOSE, COSTS OFF) +SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can't be pushed down, view owner not current user +SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; +ALTER VIEW v4 OWNER TO CURRENT_USER; +EXPLAIN (VERBOSE, COSTS OFF) +SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can be pushed down +SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; +ALTER VIEW v4 OWNER TO regress_view_owner; -- cleanup DROP OWNED BY regress_view_owner; diff --git a/src/postgres/src/backend/parser/gram.y b/src/postgres/src/backend/parser/gram.y index bdd55f66d101..7a35ee597f63 100644 --- a/src/postgres/src/backend/parser/gram.y +++ b/src/postgres/src/backend/parser/gram.y @@ -2096,7 +2096,6 @@ AlterTableStmt: } | ALTER VIEW qualified_name alter_table_cmds { - parser_ybc_signal_unsupported(@1, "ALTER VIEW", 1131); AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = $3; n->cmds = $4; @@ -2106,7 +2105,6 @@ AlterTableStmt: } | ALTER VIEW IF_P EXISTS qualified_name alter_table_cmds { - parser_ybc_signal_unsupported(@1, "ALTER VIEW", 1131); AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = $5; n->cmds = $6; @@ -9572,7 +9570,6 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name } | ALTER VIEW qualified_name RENAME TO name { - parser_ybc_signal_unsupported(@1, "ALTER VIEW", 1131); RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_VIEW; n->relation = $3; @@ -9583,7 +9580,6 @@ RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name } | ALTER VIEW IF_P EXISTS qualified_name RENAME TO name { - parser_ybc_signal_unsupported(@1, "ALTER VIEW", 1131); RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_VIEW; n->relation = $5; @@ -10062,6 +10058,7 @@ AlterObjectSchemaStmt: } | ALTER TABLE relation_expr SET SCHEMA name { + parser_ybc_not_support(@1, "ALTER TABLE SET SCHEMA"); AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_TABLE; n->relation = $3; @@ -10071,6 +10068,7 @@ AlterObjectSchemaStmt: } | ALTER TABLE IF_P EXISTS relation_expr SET SCHEMA name { + parser_ybc_not_support(@1, "ALTER TABLE SET SCHEMA"); AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_TABLE; n->relation = $5; @@ -10146,7 +10144,6 @@ AlterObjectSchemaStmt: } | ALTER VIEW qualified_name SET SCHEMA name { - parser_ybc_signal_unsupported(@1, "ALTER VIEW SET SCHEMA", 1131); AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_VIEW; n->relation = $3; @@ -10156,7 +10153,6 @@ AlterObjectSchemaStmt: } | ALTER VIEW IF_P EXISTS qualified_name SET SCHEMA name { - parser_ybc_signal_unsupported(@1, "ALTER VIEW SET SCHEMA", 1131); AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_VIEW; n->relation = $5; diff --git a/src/postgres/src/test/regress/expected/yb_view.out b/src/postgres/src/test/regress/expected/yb_view.out new file mode 100644 index 000000000000..d3d688424b42 --- /dev/null +++ b/src/postgres/src/test/regress/expected/yb_view.out @@ -0,0 +1,123 @@ +-- +-- YB tests for views +-- +CREATE TABLE test (a int, b int, c int DEFAULT 5); +INSERT INTO test VALUES (generate_series(1, 5), generate_series(1, 5)); +CREATE VIEW test_view AS SELECT * FROM test ORDER BY a, b; +SELECT * FROM test_view; + a | b | c +---+---+--- + 1 | 1 | 5 + 2 | 2 | 5 + 3 | 3 | 5 + 4 | 4 | 5 + 5 | 5 | 5 +(5 rows) + +-- Tests for ALTER VIEW. +-- test ALTER VIEW ... ALTER COLUMN ... SET/DROP DEFAULT +ALTER VIEW test_view ALTER COLUMN c SET DEFAULT 10; +INSERT INTO test (a, b) VALUES (6, 6); +INSERT INTO test_view (a, b) VALUES (7, 7); +SELECT * FROM test_view; + a | b | c +---+---+---- + 1 | 1 | 5 + 2 | 2 | 5 + 3 | 3 | 5 + 4 | 4 | 5 + 5 | 5 | 5 + 6 | 6 | 5 + 7 | 7 | 10 +(7 rows) + +ALTER VIEW test_view ALTER COLUMN c DROP DEFAULT; +INSERT INTO test (a, b) VALUES (8, 8); +SELECT * FROM test_view; + a | b | c +---+---+---- + 1 | 1 | 5 + 2 | 2 | 5 + 3 | 3 | 5 + 4 | 4 | 5 + 5 | 5 | 5 + 6 | 6 | 5 + 7 | 7 | 10 + 8 | 8 | 5 +(8 rows) + +ALTER VIEW IF EXISTS non_existent_view ALTER COLUMN c SET DEFAULT 10; +NOTICE: relation "non_existent_view" does not exist, skipping +ALTER VIEW IF EXISTS non_existent_view ALTER COLUMN c DROP DEFAULT; +NOTICE: relation "non_existent_view" does not exist, skipping +-- test ALTER VIEW ... OWNER TO +CREATE ROLE test_role; +ALTER VIEW test_view OWNER TO test_role; +SELECT * FROM test_view; +ERROR: permission denied for table test +ALTER VIEW test_view OWNER TO CURRENT_USER; +SELECT * FROM test_view; + a | b | c +---+---+---- + 1 | 1 | 5 + 2 | 2 | 5 + 3 | 3 | 5 + 4 | 4 | 5 + 5 | 5 | 5 + 6 | 6 | 5 + 7 | 7 | 10 + 8 | 8 | 5 +(8 rows) + +ALTER VIEW IF EXISTS non_existent_view OWNER TO test_role; +NOTICE: relation "non_existent_view" does not exist, skipping +-- test ALTER VIEW ... RENAME +ALTER VIEW test_view RENAME TO test_view_renamed; +SELECT * FROM test_view_renamed; + a | b | c +---+---+---- + 1 | 1 | 5 + 2 | 2 | 5 + 3 | 3 | 5 + 4 | 4 | 5 + 5 | 5 | 5 + 6 | 6 | 5 + 7 | 7 | 10 + 8 | 8 | 5 +(8 rows) + +ALTER VIEW IF EXISTS non_existent_view RENAME TO non_existent_view_renamed; +NOTICE: relation "non_existent_view" does not exist, skipping +ALTER VIEW test_view_renamed RENAME TO test_view; +-- test ALTER VIEW ... SET SCHEMA +CREATE SCHEMA test_schema; +ALTER VIEW test_view SET SCHEMA test_schema; +SELECT * FROM test_schema.test_view; + a | b | c +---+---+---- + 1 | 1 | 5 + 2 | 2 | 5 + 3 | 3 | 5 + 4 | 4 | 5 + 5 | 5 | 5 + 6 | 6 | 5 + 7 | 7 | 10 + 8 | 8 | 5 +(8 rows) + +ALTER VIEW test_schema.test_view SET SCHEMA public; +SELECT * FROM test_view; + a | b | c +---+---+---- + 1 | 1 | 5 + 2 | 2 | 5 + 3 | 3 | 5 + 4 | 4 | 5 + 5 | 5 | 5 + 6 | 6 | 5 + 7 | 7 | 10 + 8 | 8 | 5 +(8 rows) + +ALTER VIEW IF EXISTS non_existent_view SET SCHEMA test_schema; +NOTICE: relation "non_existent_view" does not exist, skipping diff --git a/src/postgres/src/test/regress/sql/yb_view.sql b/src/postgres/src/test/regress/sql/yb_view.sql new file mode 100644 index 000000000000..d051d36c18a7 --- /dev/null +++ b/src/postgres/src/test/regress/sql/yb_view.sql @@ -0,0 +1,39 @@ +-- +-- YB tests for views +-- + +CREATE TABLE test (a int, b int, c int DEFAULT 5); +INSERT INTO test VALUES (generate_series(1, 5), generate_series(1, 5)); +CREATE VIEW test_view AS SELECT * FROM test ORDER BY a, b; +SELECT * FROM test_view; + +-- Tests for ALTER VIEW. +-- test ALTER VIEW ... ALTER COLUMN ... SET/DROP DEFAULT +ALTER VIEW test_view ALTER COLUMN c SET DEFAULT 10; +INSERT INTO test (a, b) VALUES (6, 6); +INSERT INTO test_view (a, b) VALUES (7, 7); +SELECT * FROM test_view; +ALTER VIEW test_view ALTER COLUMN c DROP DEFAULT; +INSERT INTO test (a, b) VALUES (8, 8); +SELECT * FROM test_view; +ALTER VIEW IF EXISTS non_existent_view ALTER COLUMN c SET DEFAULT 10; +ALTER VIEW IF EXISTS non_existent_view ALTER COLUMN c DROP DEFAULT; +-- test ALTER VIEW ... OWNER TO +CREATE ROLE test_role; +ALTER VIEW test_view OWNER TO test_role; +SELECT * FROM test_view; +ALTER VIEW test_view OWNER TO CURRENT_USER; +SELECT * FROM test_view; +ALTER VIEW IF EXISTS non_existent_view OWNER TO test_role; +-- test ALTER VIEW ... RENAME +ALTER VIEW test_view RENAME TO test_view_renamed; +SELECT * FROM test_view_renamed; +ALTER VIEW IF EXISTS non_existent_view RENAME TO non_existent_view_renamed; +ALTER VIEW test_view_renamed RENAME TO test_view; +-- test ALTER VIEW ... SET SCHEMA +CREATE SCHEMA test_schema; +ALTER VIEW test_view SET SCHEMA test_schema; +SELECT * FROM test_schema.test_view; +ALTER VIEW test_schema.test_view SET SCHEMA public; +SELECT * FROM test_view; +ALTER VIEW IF EXISTS non_existent_view SET SCHEMA test_schema; diff --git a/src/postgres/src/test/regress/yb_misc_serial_schedule b/src/postgres/src/test/regress/yb_misc_serial_schedule index 0d0bc4df5504..fcc2ec5abed8 100644 --- a/src/postgres/src/test/regress/yb_misc_serial_schedule +++ b/src/postgres/src/test/regress/yb_misc_serial_schedule @@ -19,3 +19,4 @@ test: yb_query_consistent_snapshot test: yb_obj_properties_functions test: yb_dependency test: yb_create_language +test: yb_view