Created
July 6, 2017 08:20
-
-
Save RhysC/3497dfe5da1d15a210f24a811e1d2963 to your computer and use it in GitHub Desktop.
Generate Select * (with column names defined ) in postgres
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 'SELECT ' || string_agg(column_name, ', ') || ' FROM ' || table_name | |
FROM information_schema.columns | |
WHERE table_schema='my_schema' | |
GROUP BY table_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment