Postgres describe table
- postgres show table details
- postgres get table details
- postgres list table details
- postgres show table columns
Describe table postgres pgadmin 4.
How to describe table in postgres pgadmin
PostgreSQL – Describe Table
Unlike MySQL, PostgreSQL does not have a ‘DESCRIBE’statement to view table column details.
However, PostgreSQL provides several methods to access information about table columns.
In this article, we’ll learn two effective ways to Describe Tables in PostgreSQL.
1. Using the pSQL shell
The ‘psql’ command-line interface in PostgreSQL offers commands to describe table structures.
The information on various columns of a table can be achieved by any of the below commands.
Syntax:
\d or \d+Example:
In this example, we will describe the table city of the sample database, ie, dvdrental:
First, log into the PostgreSQL server using the pSQL shell:
Now shift to the dvdrental database using the below command:
\c dvdrentalNow use the below command to describe the city table:
\d city;This will result in the below:
The below command can also be used for the same purpose:
\d+ cityOutput:
Explanation: The output of ‘\d city’ or ‘\d+ city’
- postgres show table structure
- postgres show table data