From 7ef7ae7d0cb536576d7970b9ccb799addc1386cb Mon Sep 17 00:00:00 2001 From: Shigeru Hanada Date: Mon, 4 Apr 2011 19:12:14 +0900 Subject: [PATCH 2/5] Add regression tests for COMMENT ON USER MAPPING. --- src/test/regress/expected/foreign_data.out | 3 +++ src/test/regress/sql/foreign_data.sql | 3 +++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/test/regress/expected/foreign_data.out b/src/test/regress/expected/foreign_data.out index c05bcab..81298f6 100644 --- a/src/test/regress/expected/foreign_data.out +++ b/src/test/regress/expected/foreign_data.out @@ -567,6 +567,7 @@ RESET ROLE; (7 rows) -- ALTER USER MAPPING +COMMENT ON USER MAPPING FOR current_user SERVER s8 IS 'postgres on s8'; ALTER USER MAPPING FOR regress_test_missing_role SERVER s4 OPTIONS (gotcha 'true'); -- ERROR ERROR: role "regress_test_missing_role" does not exist ALTER USER MAPPING FOR user SERVER ss4 OPTIONS (gotcha 'true'); -- ERROR @@ -578,6 +579,8 @@ ERROR: invalid option "username" HINT: Valid options in this context are: user, password ALTER USER MAPPING FOR current_user SERVER s8 OPTIONS (DROP user, SET password 'public'); SET ROLE regress_test_role; +COMMENT ON USER MAPPING FOR regress_test_role SERVER s5 IS 'regress_test_role on s5'; +COMMENT ON USER MAPPING FOR public SERVER t1 IS 'public on t1'; ALTER USER MAPPING FOR current_user SERVER s5 OPTIONS (ADD modified '1'); ALTER USER MAPPING FOR public SERVER s4 OPTIONS (ADD modified '1'); -- ERROR ERROR: must be owner of foreign server s4 diff --git a/src/test/regress/sql/foreign_data.sql b/src/test/regress/sql/foreign_data.sql index 0d12b98..068d0c9 100644 --- a/src/test/regress/sql/foreign_data.sql +++ b/src/test/regress/sql/foreign_data.sql @@ -230,12 +230,15 @@ RESET ROLE; \deu -- ALTER USER MAPPING +COMMENT ON USER MAPPING FOR current_user SERVER s8 IS 'postgres on s8'; ALTER USER MAPPING FOR regress_test_missing_role SERVER s4 OPTIONS (gotcha 'true'); -- ERROR ALTER USER MAPPING FOR user SERVER ss4 OPTIONS (gotcha 'true'); -- ERROR ALTER USER MAPPING FOR public SERVER s5 OPTIONS (gotcha 'true'); -- ERROR ALTER USER MAPPING FOR current_user SERVER s8 OPTIONS (username 'test'); -- ERROR ALTER USER MAPPING FOR current_user SERVER s8 OPTIONS (DROP user, SET password 'public'); SET ROLE regress_test_role; +COMMENT ON USER MAPPING FOR regress_test_role SERVER s5 IS 'regress_test_role on s5'; +COMMENT ON USER MAPPING FOR public SERVER t1 IS 'public on t1'; ALTER USER MAPPING FOR current_user SERVER s5 OPTIONS (ADD modified '1'); ALTER USER MAPPING FOR public SERVER s4 OPTIONS (ADD modified '1'); -- ERROR ALTER USER MAPPING FOR public SERVER t1 OPTIONS (ADD modified '1'); -- 1.7.3