Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/postgrex/types.ex
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ defmodule Postgrex.Types do
filter_oids =
case oids do
[] ->
""
"""
WHERE (t.typrelid = 0)
AND (t.typelem = 0 OR t.typelem IN (SELECT oid FROM pg_catalog.pg_type WHERE typrelid = 0))
"""

_ ->
# equiv to `WHERE t.oid NOT IN (SELECT unnest(ARRAY[#{Enum.join(oids, ",")}]))`
# `unnest` is not supported in redshift or postgres version prior to 8.4
Expand Down