Re: Two PostgreSQL instances returning different output for same query

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Two PostgreSQL instances returning different output for same query
Дата
Msg-id 3678519.1661875571@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Two PostgreSQL instances returning different output for same query  (John Scalia <jayknowsunix@gmail.com>)
Список pgsql-admin
John Scalia <jayknowsunix@gmail.com> writes:
> I’m a bit stumped on this one. For one of my application teams both their DEV instance and UAT instance are running
pgversion 12.3 in AWS RDS, and I’ve 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
versionsof Postgis. DEV is 3.0.2 while UAT is 2.5.2, but I don’t 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



В списке pgsql-admin по дате отправления:

Предыдущее
От: Ron
Дата:
Сообщение: Re: Two PostgreSQL instances returning different output for same query
Следующее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: Two PostgreSQL instances returning different output for same query