Re: change in behaviour for format_type() call

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Rushabh Lathia <rushabh.lathia@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2018-03-01T16:40:07Z
Lists: pgsql-hackers
I wrote:
> I don't see anything in the commit message or linked discussion to
> indicate that any visible behavior change was intended, so I think
> you're right, this is a bug.  Will check and push your patch.

Actually, this patch still wasn't quite right: although it fixed
one aspect of the behavior, it still produced identical results
for typemod NULL and typemod -1, which as the function's comment
explains is not what should happen.  I tweaked the logic to look
as much as possible like before, and added a regression test.

			regards, tom lane


Commits

  1. Fix format_type() to restore its old behavior.

  2. Refactor format_type APIs to be more modular