From 53b4280456841e3c4cb554fd34fd611a58bf715e Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Tue, 4 Jul 2017 11:36:08 -0500 Subject: [PATCH] Automatically register enum types fixes #287 --- conn.go | 2 +- pgmock/pgmock.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conn.go b/conn.go index da8ed655..0d51228d 100644 --- a/conn.go +++ b/conn.go @@ -388,7 +388,7 @@ func (c *Conn) initConnInfo() error { from pg_type t left join pg_type base_type on t.typelem=base_type.oid where ( - t.typtype in('b', 'p', 'r') + t.typtype in('b', 'p', 'r', 'e') and (base_type.oid is null or base_type.typtype in('b', 'p', 'r')) )`) if err != nil { diff --git a/pgmock/pgmock.go b/pgmock/pgmock.go index 5e340881..fe78b009 100644 --- a/pgmock/pgmock.go +++ b/pgmock/pgmock.go @@ -204,7 +204,7 @@ func AcceptUnauthenticatedConnRequestSteps() []Step { func PgxInitSteps() []Step { steps := []Step{ ExpectMessage(&pgproto3.Parse{ - Query: "select t.oid, t.typname\nfrom pg_type t\nleft join pg_type base_type on t.typelem=base_type.oid\nwhere (\n\t t.typtype in('b', 'p', 'r')\n\t and (base_type.oid is null or base_type.typtype in('b', 'p', 'r'))\n\t)", + Query: "select t.oid, t.typname\nfrom pg_type t\nleft join pg_type base_type on t.typelem=base_type.oid\nwhere (\n\t t.typtype in('b', 'p', 'r', 'e')\n\t and (base_type.oid is null or base_type.typtype in('b', 'p', 'r'))\n\t)", }), ExpectMessage(&pgproto3.Describe{ ObjectType: 'S',