Last active
January 30, 2018 14:40
-
-
Save lene/3b03498ef6123ac3f057 to your computer and use it in GitHub Desktop.
Select a list of all keys in an HSTORE field across the entire table
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
CREATE TABLE my_hstore_table ( | |
id SERIAL NOT NULL, | |
attributes HSTORE NOT NULL | |
); | |
SELECT DISTINCT UNNEST(AKEYS(attributes)) AS key FROM my_hstore_table ORDER BY key; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment