Skip to content

Commit

Permalink
Register postgres UUID type if possible, and add array_agg to blacklist.
Browse files Browse the repository at this point in the history
Refs #2364
  • Loading branch information
coleifer committed Mar 4, 2021
1 parent 666a709 commit fcd3269
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion peewee.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
pg_errors = None
except ImportError:
psycopg2 = pg_errors = None
try:
from psycopg2.extras import register_uuid as pg_register_uuid
pg_register_uuid()
except Exception:
pass

mysql_passwd = False
try:
Expand Down Expand Up @@ -1524,7 +1529,7 @@ def __init__(self, name, arguments, coerce=True, python_value=None):
self._filter = None
self._order_by = None
self._python_value = python_value
if name and name.lower() in ('sum', 'count', 'cast'):
if name and name.lower() in ('sum', 'count', 'cast', 'array_agg'):
self._coerce = False
else:
self._coerce = coerce
Expand Down

0 comments on commit fcd3269

Please sign in to comment.