summaryrefslogtreecommitdiff
path: root/psycopg/connection_int.c
diff options
context:
space:
mode:
Diffstat (limited to 'psycopg/connection_int.c')
-rw-r--r--psycopg/connection_int.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/psycopg/connection_int.c b/psycopg/connection_int.c
index 83c77ad..6dc7ebb 100644
--- a/psycopg/connection_int.c
+++ b/psycopg/connection_int.c
@@ -373,6 +373,10 @@ conn_is_datestyle_ok(PGconn *pgconn)
ds = PQparameterStatus(pgconn, "DateStyle");
Dprintf("conn_connect: DateStyle %s", ds);
+ /* pgbouncer does not pass on DateStyle */
+ if (ds == NULL)
+ return 0;
+
/* Return true if ds starts with "ISO"
* e.g. "ISO, DMY" is fine, "German" not. */
return (ds[0] == 'I' && ds[1] == 'S' && ds[2] == 'O');