Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oT3kp-0004R8-Tm for pgsql-admin@arkaria.postgresql.org; Tue, 30 Aug 2022 16:06:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oT3ko-0002zS-Ot for pgsql-admin@arkaria.postgresql.org; Tue, 30 Aug 2022 16:06:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oT3ko-0002zJ-Es for pgsql-admin@lists.postgresql.org; Tue, 30 Aug 2022 16:06:18 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oT3kk-00019N-8k for pgsql-admin@lists.postgresql.org; Tue, 30 Aug 2022 16:06:17 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 27UG6BoM3678520; Tue, 30 Aug 2022 12:06:11 -0400 From: Tom Lane To: John Scalia cc: Pgsql-admin Subject: Re: Two PostgreSQL instances returning different output for same query In-reply-to: References: Comments: In-reply-to John Scalia message dated "Tue, 30 Aug 2022 11:21:26 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <3678518.1661875571.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 30 Aug 2022 12:06:11 -0400 Message-ID: <3678519.1661875571@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk John Scalia writes: > I=E2=80=99m a bit stumped on this one. For one of my application teams b= oth their DEV instance and UAT instance are running pg version 12.3 in AWS= RDS, and I=E2=80=99ve used the same psql version 13.4. > The query is a simple: SELECT to_jsonb(geom) FROM addresses LIMIT 1; > On both databases the geom field is of data type geometry from postgis, = but the two dbs are running different versions of Postgis. DEV is 3.0.2 wh= ile UAT is 2.5.2, but I don=E2=80=99t think this is causing the issue. I think you're being far too hasty to reject a highly probable explanation. Consult the Postgis release notes to see if they changed anything about casting-to-JSON between those two releases. A quick look at to_jsonb's innards shows that for a non-core input type, it will use the type's cast to JSON if there is one, while if there is not, it will just run the type's output function and call the result a JSON string. This seems to fit quite well with the results you show. regards, tom lane