d Verified current stable Not installed? Data Processing

D / Display Database Schema Interactively

Display Database Schema Interactively

Display the current database schema in a readable format.

$
Terminal
\d

When To Use

To inspect the structure of the database before making modifications.

Pro Tip

Utilize the ` iming` command to measure the response time for schema display.

Anatomy of Output

Understanding the result

Schema: public Schema Name

Indicates the current active schema.

Table "public.users" Table Name

Name of the table being described.

Column | Type | Modifiers Output Columns

Column names and their respective types.

Troubleshooting

Common pitfalls

ERROR: relation "users" does not exist

Solution: Double-check the schema name and ensure the table exists.

ERROR: permission denied for relation "users"

Solution: Verify user permissions for accessing the table.

ERROR: invalid schema name

Solution: Correct the schema name or check for spelling errors.

Command Breakdown

What each part is doing

\d
Base Command
The executable that performs this operation. Here it runs D before the shell applies any redirect operators.

Alternative Approaches

Comparable commands in other tools

Alternative data processing tools for the same job.