Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dWVqI-0007tt-MB for pgsql-jdbc@arkaria.postgresql.org; Sat, 15 Jul 2017 22:47:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dWVqH-0008Oa-Tp for pgsql-jdbc@arkaria.postgresql.org; Sat, 15 Jul 2017 22:47:17 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dWVpn-0007VU-7u for pgsql-jdbc@postgresql.org; Sat, 15 Jul 2017 22:46:47 +0000 Received: from mail-io0-x22b.google.com ([2607:f8b0:4001:c06::22b]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dWVpj-0007hc-J4 for pgsql-jdbc@postgresql.org; Sat, 15 Jul 2017 22:46:45 +0000 Received: by mail-io0-x22b.google.com with SMTP id h64so28649775iod.0 for ; Sat, 15 Jul 2017 15:46:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seespotcode-net.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:subject:message-id:date:to :mime-version; bh=fLlrSl7qFYvhqloJjskNUraLPdfKTbTD4g5glzZuyto=; b=I2e3ZLSEt+8ooU2zHOY6BwB5+pCOy2ubJoaPlLhTzgdpnGxjybB7Eibkb5gd0jtu/L 1nsk4tIv+YKA7Ecy9V1X5t1SvdbT7Oof6rmX23PY+bA31B+loh5WUg2LCHjj947Vo23u /UzgxsYosu9bZ22RyemgQjOWih+9WgHXBUmMdn6Oga0s7kVaBRs5MJ/AgqMUDWAYl9Eh E2seiMx4n0fthgLBRXEogRh8xDD+pwX8z4Ge1yRdS6YrxEWxcjwQf1yu/ZrS0fGP3leq 6Bc6JfCHRxSDvmuTccNdovXKeRlyOahaywyGbkmdW0HNCEl1WmvuUNwiWw7ynQ8B1hFi XHpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:subject :message-id:date:to:mime-version; bh=fLlrSl7qFYvhqloJjskNUraLPdfKTbTD4g5glzZuyto=; b=PbYKoZ2rPioR+8I4luEUD++3CNGYYtkmhTchILojH4rgv23Yn1/S3/y4P2xgGUTHdk qx7g+VxyeCFXMzqI3wbla1G3QU6w8y6SUMqyDZRqBmqOuR6K6VRElN9ipBPU5ylyQtO2 k1dErfTQuD1eOSUILN4iJddwenFB2+6MZUVR7y9RMBIfoRrG0NbD3P38wmISznycyPek D88x4Xzx/MMCCOZwLEg6oDesQs/aJj58lV2Ieu+DNLGkTfddxMrLSmLtgUvc/ohx9/JC Y/KXxpihM+14BKqW0ML3+bGLjDWcp/MJTOcfYKvZvBpKbx4QGHyeHfGK34q8QdWN+hua FzuA== X-Gm-Message-State: AIVw112g8kzb8vAimBkDm5zS+XSBEGqNPDbXO3Zc+HNy0cX3Kjny2IS5 9pJ7/rNUA7Oc8hCk9Mom7w== X-Received: by 10.107.12.21 with SMTP id w21mr14333460ioi.61.1500158801698; Sat, 15 Jul 2017 15:46:41 -0700 (PDT) Received: from [192.168.1.4] (71-8-133-184.dhcp.stcd.mn.charter.com. [71.8.133.184]) by smtp.gmail.com with ESMTPSA id p69sm6446955iod.4.2017.07.15.15.46.41 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 15 Jul 2017 15:46:41 -0700 (PDT) From: Michael Glaesemann Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: TypeInfoCache.getPGType(pgTypeName) drops schema name when caching Message-Id: <72F45272-226E-47FC-940F-F5E5FF446222@seespotcode.net> Date: Sat, 15 Jul 2017 17:46:39 -0500 To: List Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) X-Mailer: Apple Mail (2.2104) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org When populating the _oidToPgName and _pgNameToOid caches, TypeInfoCache.get= PGType(String pgTypeName) populates _oidToPgName with only pg_type.typname = regardless of typnamespace or the search path. This results in the cache re= turning unqualified type names in lookups to cached values by getPGType(int= oid). It makes sense to normalize the name, which is presumably what motivates us= ing internalName returned from oidStatement rather than the user-supplied p= gTypeName. getPGType(oid) does schema-qualify the name used to populate _oi= dToPgName: _pgNameToOid.put(schema + "." + name, oid) I think it makes sense to follow this behavior in getPGType(pgTypeName). Lo= oking at it briefly, I wonder if adding "nspname =3D ANY(current_schemas(= true))" and nspname columns to the results of oidStatement would be suffic= ient, and using those to construct a normalized qualified type name in the = manner of getPGType(oid). If this makes sense, I'm happy to submit a patch with tests. Cheers, Michael Glaesemann grzm seespotcode net PS. When looking through open issues to see if this had been reported, I ca= me across https://github.com/pgjdbc/pgjdbc/issues/189 "Connection.createArr= ayOf() does not handle enums correctly.". I think what I describe above is = the root cause of this as well, as TypeInfoCache.getPGArrayType calls getPG= Type(pgTypeName). --=20 Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc