\d meta-commands
Vertica supports a number of \d commands, which return information on different categories of database objects.
Vertica supports a number of \d
commands, which return information on different categories of database objects. For a full list, see \d Reference below.
Syntax
Unless otherwise noted, \d
commands generally conform to the following syntax:
\dCommand [ [schema.]pattern ]
Arguments
You can supply most \d commands with a string pattern argument, which filters the results that the command returns. The pattern can optionally be qualified by a schema name.
schema
- Valid for most
\d
commands, restricts output to only database objects inschema
. For example, the following\dp
command obtains privileges information for allV_MONITOR
tables that contain the stringresource
:=> \dp V_MONITOR.*resource* Access privileges for database "dbadmin" Grantee | Grantor | Privileges | Schema | Name ---------+---------+------------+-----------+---------------------------- public | dbadmin | SELECT | v_monitor | resource_rejections public | dbadmin | SELECT | v_monitor | disk_resource_rejections public | dbadmin | SELECT | v_monitor | resource_usage public | dbadmin | SELECT | v_monitor | resource_acquisitions public | dbadmin | SELECT | v_monitor | resource_rejection_details public | dbadmin | SELECT | v_monitor | resource_pool_move public | dbadmin | SELECT | v_monitor | host_resources public | dbadmin | SELECT | v_monitor | node_resources public | dbadmin | SELECT | v_monitor | resource_queues public | dbadmin | SELECT | v_monitor | resource_pool_status (10 rows)
pattern
- Returns only the database objects that match the specified string. Pattern strings can include the following wildcards:
-
*
(asterisk): zero or more characters. -
?
(question mark): any single character.
For example, the following
\dt
command returns tables that start with the stringstore
:=> \dt store* List of tables Schema | Name | Kind | Owner | Comment --------+-------------------+-------+---------+--------- public | store_orders | table | dbadmin | public | store_orders_2018 | table | dbadmin | public | store_overseas | table | dbadmin | store | store_dimension | table | dbadmin | store | store_orders_fact | table | dbadmin | store | store_sales_fact | table | dbadmin | (6 rows)
-
\d reference
\d
- Unqualified by a pattern argument, returns all tables with their schema names, owners, and comments. If qualified by a pattern argument,
\d
returns all matching tables and all columns in each table, with details about each column, such as data type, size, and default value. \df
- Returns all function names, the function return data type, and the function argument data type. Also returns the procedure names and arguments for all procedures that are available to the user.
\dj
- Returns all projections showing the schema, projection name, owner, and node. The returned rows include superprojections, live aggregate projections, Top-K projections, and projections with expressions.
\dn
- Returns the schema names and schema owner.
\dp
- Returns a summary of privileges on all objects in system table
V_CATALOG.GRANTS
: grantee, grantor, privileges, schema, and object name (equivalent to\z
). \dS
- Unqualified by a pattern argument, returns all
V_CATALOG
andV_MONITOR
system tables. To obtain system tables for just one schema, qualify the command with the schema name, as follows:\dS { V_CATALOG | V_MONITOR }.*
\ds
- Returns sequences and their parameters.
\dT
- Returns all data types that Vertica supports.
Note
\dT
returns no results if qualified with a pattern argument. \dt
- Unqualified by a pattern argument, returns the same information as an unqualified
\d
command. If qualified by a pattern argument,\dt
returns matching tables with the same level of detail as an unqualified\dt
command. \dtv
- Returns tables and views.
\du
- Returns database users and whether they are superusers.
\dv
- Unqualified by a pattern argument, returns all views with their schema names, owners, and comments. If qualified by a pattern argument,
\dv
returns all matching views and the columns in each view, with each column's data type and size.