Skip to content

Instantly share code, notes, and snippets.

@drawcode
Last active March 23, 2023 08:18
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save drawcode/4441656 to your computer and use it in GitHub Desktop.
Save drawcode/4441656 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