Last active
March 23, 2023 08:18
-
-
Save drawcode/4441656 to your computer and use it in GitHub Desktop.
Check if column exists on table in PGSQL
This file contains 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 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