Created
October 24, 2022 13:51
-
-
Save jorgearimitsu/373a59d3d95da3d395e5fa7552473ec1 to your computer and use it in GitHub Desktop.
Type map query from rails 6.1.7
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 t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype | |
FROM pg_type as t | |
LEFT JOIN pg_range as r ON oid = rngtypid | |
WHERE | |
t.typname IN ('int2', 'int4', 'int8', 'oid', 'float4', 'float8', 'text', 'varchar', 'char', 'name', 'bpchar', 'bool', 'bit', 'varbit', 'timestamptz', 'date', 'money', 'bytea', 'point', 'hstore', 'json', 'jsonb', 'cidr', 'inet', 'uuid', 'xml', 'tsvector', 'macaddr', 'citext', 'ltree', 'line', 'lseg', 'box', 'path', 'polygon', 'circle', 'time', 'timestamp', 'numeric', 'interval') | |
OR t.typtype IN ('r', 'e', 'd') | |
OR t.typinput = 'array_in(cstring,oid,integer)'::regprocedure | |
OR t.typelem != 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Upgrading to PostgreSQL 14 improved the performance: