feat: add S suffix for system-object variants of relation commands#162
feat: add S suffix for system-object variants of relation commands#162devadathanmb wants to merge 7 commits into
Conversation
- add S variants for relation listing and description while preserving schema visibility - match psql pattern, special-relation, TOAST, and partitioned-index behavior - add catalog, visibility, detail, and TOAST tests plus a changelog entry
- add a partitioned table and index to the shared database fixture - verify `\diS` includes partitioned indexes - verify `\dtS+` returns verbose relation metadata
- remove partitioned-index objects from the shared database setup - create and clean up the objects within the relevant test - skip the test when partitioned indexes are unsupported
- Route \dE and \dES through a shared private helper. - Omit system-schema exclusions for \dES and advertise its S modifier. - Add FDW integration coverage for \dES.
- route `\dE` and `\dES` through the shared relation-listing implementation - add FDW coverage for a schema-qualified foreign table outside the search path
|
|
||
| """ | ||
| schema_pattern, table_pattern = sql_name_pattern(pattern) | ||
| include_system_relations = show_system or bool(pattern) |
There was a problem hiding this comment.
psql includes system relations when the user supplies either S or an explicit pattern.
Keeping that rule in list_objects() removes the need for \dv, \dm, \ds, and \di to request the legacy s relation kind themselves. Unpatterned non-S commands no longer request special relations, while S variants and explicit-pattern searches still include them.
psql applies the same relation-kind filtering in listTables()
| ORDER BY 1,2; | ||
| """ | ||
| ) | ||
| return list_objects(cur, pattern, verbose, ["f", ""]) |
There was a problem hiding this comment.
The old _list_foreign_tables() query duplicated most of list_objects() and handled patterns differently.
It discarded the schema returned by sql_name_pattern() and always applied pg_table_is_visible(). That made schema-qualified patterns fail when the schema was outside search_path.
Using list_objects() here fixes the pattern handling and removes the duplicate query.
Description
Continues the work started in #160.
psqllets you appendSto\d-family commands to include system objects. Running\dSin pgcli currently produces an error.This adds
Svariants for all relation-listing commands:\dS\dtS\dvS\dmS\dsS\diS\dESAll variants support the
+verbose modifier, such as\dtS+.Closes dbcli/pgcli#1523
Checklist
changelog.rst.pip install pre-commit && pre-commit install).