-
-
Save athiwatp/d7358dbfe97132fdac36386740392a0f to your computer and use it in GitHub Desktop.
Check if column exists on table in PGSQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select table_name from user_tab_columns | |
| where table_name = myTable and column_name = myColumn; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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