diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/regress/expected/guc.out | 16 | ||||
| -rw-r--r-- | src/test/regress/sql/guc.sql | 18 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/test/regress/expected/guc.out b/src/test/regress/expected/guc.out index 271706d31e9..7b5a624eb8f 100644 --- a/src/test/regress/expected/guc.out +++ b/src/test/regress/expected/guc.out @@ -718,3 +718,19 @@ select myfunc(1), current_setting('work_mem'); 2MB | 2MB (1 row) +-- Normally, CREATE FUNCTION should complain about invalid values in +-- function SET options; but not if check_function_bodies is off, +-- because that creates ordering hazards for pg_dump +create function func_with_bad_set() returns int as $$ select 1 $$ +language sql +set default_text_search_config = no_such_config; +NOTICE: text search configuration "no_such_config" does not exist +ERROR: invalid value for parameter "default_text_search_config": "no_such_config" +set check_function_bodies = off; +create function func_with_bad_set() returns int as $$ select 1 $$ +language sql +set default_text_search_config = no_such_config; +NOTICE: text search configuration "no_such_config" does not exist +select func_with_bad_set(); +ERROR: invalid value for parameter "default_text_search_config": "no_such_config" +reset check_function_bodies; diff --git a/src/test/regress/sql/guc.sql b/src/test/regress/sql/guc.sql index 0c217923814..3de8a6b55d6 100644 --- a/src/test/regress/sql/guc.sql +++ b/src/test/regress/sql/guc.sql @@ -257,3 +257,21 @@ set work_mem = '1MB'; select myfunc(0); select current_setting('work_mem'); select myfunc(1), current_setting('work_mem'); + +-- Normally, CREATE FUNCTION should complain about invalid values in +-- function SET options; but not if check_function_bodies is off, +-- because that creates ordering hazards for pg_dump + +create function func_with_bad_set() returns int as $$ select 1 $$ +language sql +set default_text_search_config = no_such_config; + +set check_function_bodies = off; + +create function func_with_bad_set() returns int as $$ select 1 $$ +language sql +set default_text_search_config = no_such_config; + +select func_with_bad_set(); + +reset check_function_bodies; |
