shlogg · Early preview
Dbvisualizer @dbvis-marketing

PostgreSQL Table Description Alternatives

PostgreSQL lacks a DESCRIBE statement like MySQL. Use psql command line, querying Information Schema or DbVisualizer for table descriptions instead.

The lack of a DESCRIBE statement in PostgreSQL may puzzle users familiar with MySQL. This article briefly introduces the alternatives available in PostgreSQL to describe tables.
Here are some examples of DESCRIBE TABLE alternatives in PostgreSQL:

  
  
  Command Line via psql

Commands: <table_name> and <table_name> for more details.
Pros: Provides a lot of information about the table.
Cons: The command-line interface may be less appealing to those not accustomed to it.

  
  
  Querying Information Schema


SELECT column_name, data_type 
FROM information_schema.columns 
WHERE table_name = <t...