Last active
October 13, 2020 03:41
-
-
Save SanthoshBabuMR/3c7cbf32bc625769572e2e3a76043079 to your computer and use it in GitHub Desktop.
postgres cheatsheet
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
-- find tables | |
SELECT * | |
FROM information_schema.tables | |
WHERE table_schema = 'public' | |
and table_name like '%pattern%' | |
ORDER BY table_type, table_name; | |
-- DESC table | |
SELECT | |
table_name, | |
column_name, | |
data_type | |
FROM | |
information_schema.columns | |
WHERE | |
table_name = '<table_name>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment