Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save athiwatp/d7358dbfe97132fdac36386740392a0f to your computer and use it in GitHub Desktop.

Select an option

Save athiwatp/d7358dbfe97132fdac36386740392a0f to your computer and use it in GitHub Desktop.
Check if column exists on table in PGSQL
select table_name from user_tab_columns
where table_name = myTable and column_name = myColumn;
SELECT column_name
FROM information_schema.columns
WHERE table_name='your_table' and column_name='your_column';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment