Skip to content

Instantly share code, notes, and snippets.

@mmasashi
Created February 6, 2013 18:12
Show Gist options
  • Save mmasashi/4724564 to your computer and use it in GitHub Desktop.
Save mmasashi/4724564 to your computer and use it in GitHub Desktop.
Get table columns with a sql on postgresql. It's same as `\d table_name`.
select column_name from INFORMATION_SCHEMA.COLUMNS where table_name = 'table_name' order by ordinal_position;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment