Skip to content

Commit edbb44e

Browse files
tglsfdcpull[bot]
authored andcommitted
Remove new locale dependency in regproc regression test.
The modified error message for regcollationin failure includes the database encoding, which it should've occurred to me is a portability hazard for the regression tests. Adjust the test so the expected output doesn't include that. In passing, fix a comment typo introduced in b8c0ffb. Per buildfarm.
1 parent 9044a73 commit edbb44e

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

src/backend/utils/adt/domains.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ domain_state_setup(Oid domainType, bool binary, MemoryContext mcxt)
127127
* execExpr*.c, but we execute each constraint separately, rather than
128128
* compiling them in-line within a larger expression.
129129
*
130-
* If escontext points to an ErrorStateContext, any failures are reported
130+
* If escontext points to an ErrorSaveContext, any failures are reported
131131
* there, otherwise they are ereport'ed. Note that we do not attempt to do
132132
* soft reporting of errors raised during execution of CHECK constraints.
133133
*/

src/test/regress/expected/regproc.out

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@ SELECT regtype('ng_catalog.int4');
268268
ERROR: schema "ng_catalog" does not exist
269269
LINE 1: SELECT regtype('ng_catalog.int4');
270270
^
271+
\set VERBOSITY sqlstate \\ -- error message is encoding-dependent
271272
SELECT regcollation('ng_catalog."POSIX"');
272-
ERROR: collation "ng_catalog.POSIX" for encoding "SQL_ASCII" does not exist
273-
LINE 1: SELECT regcollation('ng_catalog."POSIX"');
274-
^
273+
ERROR: 42704
274+
\set VERBOSITY default
275275
-- schemaname not applicable
276276
SELECT regrole('regress_regrole_test');
277277
ERROR: role "regress_regrole_test" does not exist
@@ -454,10 +454,10 @@ SELECT pg_input_error_message('ng_catalog.pg_class', 'regclass');
454454
relation "ng_catalog.pg_class" does not exist
455455
(1 row)
456456

457-
SELECT pg_input_error_message('ng_catalog."POSIX"', 'regcollation');
458-
pg_input_error_message
459-
----------------------------------------------------------------------
460-
collation "ng_catalog.POSIX" for encoding "SQL_ASCII" does not exist
457+
SELECT pg_input_is_valid('ng_catalog."POSIX"', 'regcollation');
458+
pg_input_is_valid
459+
-------------------
460+
f
461461
(1 row)
462462

463463
SELECT pg_input_error_message('no_such_config', 'regconfig');

src/test/regress/sql/regproc.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ SELECT regproc('ng_catalog.now');
7474
SELECT regprocedure('ng_catalog.abs(numeric)');
7575
SELECT regclass('ng_catalog.pg_class');
7676
SELECT regtype('ng_catalog.int4');
77+
\set VERBOSITY sqlstate \\ -- error message is encoding-dependent
7778
SELECT regcollation('ng_catalog."POSIX"');
79+
\set VERBOSITY default
7880

7981
-- schemaname not applicable
8082

@@ -124,7 +126,7 @@ SELECT to_regnamespace('foo.bar');
124126
-- Test soft-error API
125127

126128
SELECT pg_input_error_message('ng_catalog.pg_class', 'regclass');
127-
SELECT pg_input_error_message('ng_catalog."POSIX"', 'regcollation');
129+
SELECT pg_input_is_valid('ng_catalog."POSIX"', 'regcollation');
128130
SELECT pg_input_error_message('no_such_config', 'regconfig');
129131
SELECT pg_input_error_message('no_such_dictionary', 'regdictionary');
130132
SELECT pg_input_error_message('Nonexistent', 'regnamespace');

0 commit comments

Comments
 (0)