hpqtypes 1.9.2.0 → 1.9.2.1
raw patch · 3 files changed
+14/−25 lines, 3 filesdep ~aesonPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: aeson
API changes (from Hackage documentation)
Files
- CHANGELOG.md +3/−0
- hpqtypes.cabal +2/−2
- libpqtypes/src/handler.c +9/−23
CHANGELOG.md view
@@ -1,3 +1,6 @@+# hpqtypes-1.9.2.1 (2021-11-04)+* Improve an SQL query that gets information about composite types.+ # hpqtypes-1.9.2.0 (2021-09-29) * Add method withFrozenLastQuery to (temporarily) stop recording queries.
hpqtypes.cabal view
@@ -1,5 +1,5 @@ name: hpqtypes-version: 1.9.2.0+version: 1.9.2.1 synopsis: Haskell bindings to libpqtypes description: Efficient and easy-to-use bindings to (slightly modified)@@ -126,7 +126,7 @@ build-depends: base >= 4.9 && < 5 , text >= 0.11- , aeson >= 1.0+ , aeson >= 1.0 && < 2.0 , async >= 2.1.1.1 , bytestring >= 0.9 , semigroups >= 0.16
libpqtypes/src/handler.c view
@@ -939,30 +939,16 @@ "(" \ " SELECT * FROM information_schema._pg_expandarray(%text[])" \ ")," \-"curpath AS" \-"(" \-" SELECT * FROM information_schema._pg_expandarray(current_schemas(true))" \-")," \ "composites AS" \ "(" \-" SELECT n.n AS idx, n.x AS nspname, t.x AS typname" \-" FROM nspnames n LEFT JOIN typnames t ON n.n = t.n" \-" AND n.x IS NOT NULL" \-" WHERE t.x IS NOT NULL" \-" UNION ALL" \-" SELECT n.n AS idx," \-" (" \-" SELECT n.nspname from pg_type nt JOIN pg_namespace n ON " \- "nt.typnamespace = n.oid" \-" JOIN curpath c ON c.x = n.nspname" \-" WHERE nt.typname = t.x" \-" ORDER BY c.n LIMIT 1" \-" ) AS nspname, t.x AS typname" \-" FROM nspnames n LEFT JOIN typnames t ON n.n = t.n" \-" AND n.x IS NULL" \-" WHERE t.x IS NOT NULL" \+ "SELECT t.n as idx, " \+" to_regtype(CASE WHEN n.x IS NULL" \+" THEN quote_ident(t.x)" \+" ELSE quote_ident(n.x) || '.' || quote_ident(t.x)" \+" END) AS typoid" \+" FROM nspnames n JOIN typnames t USING (n)" \ ")" \-"SELECT idx, t.oid AS typoid, a.oid AS arroid, t.typlen," \+"SELECT c.idx, t.oid AS typoid, a.oid AS arroid, t.typlen," \ " (" \ " CASE WHEN %bool THEN (" \ " SELECT array_to_string" \@@ -983,8 +969,8 @@ " ), ' ')" \ " ) ELSE NULL END) AS arr_props" \ " FROM composites c" \-" JOIN pg_type t ON t.typname = c.typname" \-" JOIN pg_namespace n ON t.typnamespace = n.oid AND n.nspname = c.nspname" \+" JOIN pg_type t ON t.oid = c.typoid" \+" JOIN pg_namespace n ON t.typnamespace = n.oid" \ " JOIN pg_type a ON a.oid = t.typarray" \ " ORDER BY idx;"