diff options
| author | Tom Lane | 2025-02-05 17:45:58 +0000 |
|---|---|---|
| committer | Tom Lane | 2025-02-05 17:45:58 +0000 |
| commit | a14707da564e8c94bd123f0e3a75e194fd7ef56a (patch) | |
| tree | ea70529d79886ed96a78abbf326857ce363d01b8 /src/test | |
| parent | ee4667f0184d87a2e58822e6a9edad563fa164fd (diff) | |
Show more-intuitive titles for psql commands \dt, \di, etc.
If exactly one relation type is requested in a command of the \dtisv
family, say "tables", "indexes", etc instead of "relations". This
should cover the majority of actual uses, without creating a huge
number of new translatable strings. The error messages for no
matching relations are adjusted as well.
In passing, invent "pg_log_error_internal()" to be used for frontend
error messages that don't seem to need translation, analogously to
errmsg_internal() in the backend. The implementation is a bit cheesy,
being just a macro to prevent xgettext from recognizing a trigger
keyword. This won't avoid a useless gettext lookup cycle at runtime
--- but surely we don't care about an extra microsecond or two in
what's supposed to be a can't-happen case. I (tgl) also made
"pg_fatal_internal()", though it's not used in this patch.
Author: Greg Sabino Mullane <htamfids@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAKAnmm+7o93fQV-RFkGaN1QnP-0D4d3JTykD+cLueqjDMKdfag@mail.gmail.com
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/regress/expected/dependency.out | 2 | ||||
| -rw-r--r-- | src/test/regress/expected/psql.out | 42 |
2 files changed, 22 insertions, 22 deletions
diff --git a/src/test/regress/expected/dependency.out b/src/test/regress/expected/dependency.out index 74d9ff2998d..75a078ada9e 100644 --- a/src/test/regress/expected/dependency.out +++ b/src/test/regress/expected/dependency.out @@ -116,7 +116,7 @@ FROM pg_type JOIN pg_class c ON typrelid = c.oid WHERE typname = 'deptest_t'; RESET SESSION AUTHORIZATION; REASSIGN OWNED BY regress_dep_user1 TO regress_dep_user2; \dt deptest - List of relations + List of tables Schema | Name | Type | Owner --------+---------+-------+------------------- public | deptest | table | regress_dep_user2 diff --git a/src/test/regress/expected/psql.out b/src/test/regress/expected/psql.out index e6f7b9013d9..f9db4032e1f 100644 --- a/src/test/regress/expected/psql.out +++ b/src/test/regress/expected/psql.out @@ -3027,7 +3027,7 @@ Access method: heap (4 rows) \dt+ - List of relations + List of tables Schema | Name | Type | Owner | Persistence | Access method | Size | Description -----------------+---------------+-------+----------------------+-------------+---------------+---------+------------- tableam_display | tbl_heap | table | regress_display_role | permanent | heap | 0 bytes | @@ -3035,7 +3035,7 @@ Access method: heap (2 rows) \dm+ - List of relations + List of materialized views Schema | Name | Type | Owner | Persistence | Access method | Size | Description -----------------+--------------------+-------------------+----------------------+-------------+---------------+---------+------------- tableam_display | mat_view_heap_psql | materialized view | regress_display_role | permanent | heap_psql | 0 bytes | @@ -3043,7 +3043,7 @@ Access method: heap -- But not for views and sequences. \dv+ - List of relations + List of views Schema | Name | Type | Owner | Persistence | Size | Description -----------------+----------------+------+----------------------+-------------+---------+------------- tableam_display | view_heap_psql | view | regress_display_role | permanent | 0 bytes | @@ -6244,7 +6244,7 @@ List of access methods (0 rows) \dt "no.such.table.relation" - List of relations + List of tables Schema | Name | Type | Owner --------+------+------+------- (0 rows) @@ -6316,31 +6316,31 @@ List of access methods (0 rows) \di "no.such.index.relation" - List of relations + List of indexes Schema | Name | Type | Owner | Table --------+------+------+-------+------- (0 rows) \dm "no.such.materialized.view" - List of relations + List of materialized views Schema | Name | Type | Owner --------+------+------+------- (0 rows) \ds "no.such.relation" - List of relations + List of sequences Schema | Name | Type | Owner --------+------+------+------- (0 rows) \dt "no.such.relation" - List of relations + List of tables Schema | Name | Type | Owner --------+------+------+------- (0 rows) \dv "no.such.relation" - List of relations + List of views Schema | Name | Type | Owner --------+------+------+------- (0 rows) @@ -6474,7 +6474,7 @@ List of schemas \dA "no.such.schema"."no.such.access.method" improper qualified name (too many dotted names): "no.such.schema"."no.such.access.method" \dt "no.such.schema"."no.such.table.relation" - List of relations + List of tables Schema | Name | Type | Owner --------+------+------+------- (0 rows) @@ -6526,31 +6526,31 @@ improper qualified name (too many dotted names): "no.such.schema"."no.such.table (0 rows) \di "no.such.schema"."no.such.index.relation" - List of relations + List of indexes Schema | Name | Type | Owner | Table --------+------+------+-------+------- (0 rows) \dm "no.such.schema"."no.such.materialized.view" - List of relations + List of materialized views Schema | Name | Type | Owner --------+------+------+------- (0 rows) \ds "no.such.schema"."no.such.relation" - List of relations + List of sequences Schema | Name | Type | Owner --------+------+------+------- (0 rows) \dt "no.such.schema"."no.such.relation" - List of relations + List of tables Schema | Name | Type | Owner --------+------+------+------- (0 rows) \dv "no.such.schema"."no.such.relation" - List of relations + List of views Schema | Name | Type | Owner --------+------+------+------- (0 rows) @@ -6641,7 +6641,7 @@ improper qualified name (too many dotted names): "no.such.schema"."no.such.insta improper qualified name (too many dotted names): "no.such.schema"."no.such.event.trigger" -- again, but with current database and dotted schema qualifications. \dt regression."no.such.schema"."no.such.table.relation" - List of relations + List of tables Schema | Name | Type | Owner --------+------+------+------- (0 rows) @@ -6677,31 +6677,31 @@ improper qualified name (too many dotted names): "no.such.schema"."no.such.event (0 rows) \di regression."no.such.schema"."no.such.index.relation" - List of relations + List of indexes Schema | Name | Type | Owner | Table --------+------+------+-------+------- (0 rows) \dm regression."no.such.schema"."no.such.materialized.view" - List of relations + List of materialized views Schema | Name | Type | Owner --------+------+------+------- (0 rows) \ds regression."no.such.schema"."no.such.relation" - List of relations + List of sequences Schema | Name | Type | Owner --------+------+------+------- (0 rows) \dt regression."no.such.schema"."no.such.relation" - List of relations + List of tables Schema | Name | Type | Owner --------+------+------+------- (0 rows) \dv regression."no.such.schema"."no.such.relation" - List of relations + List of views Schema | Name | Type | Owner --------+------+------+------- (0 rows) |
