Fix format_type() to restore its old behavior.
Tom Lane <tgl@sss.pgh.pa.us>
Fix format_type() to restore its old behavior. Commit a26116c6c accidentally changed the behavior of the SQL format_type() function while refactoring. For the reasons explained in that function's comment, a NULL typemod argument should behave differently from a -1 argument. Since we've managed to break this, add a regression test memorializing the intended behavior. In passing, be consistent about the type of the "flags" parameter. Noted by Rushabh Lathia, though I revised the patch some more. Discussion: https://postgr.es/m/CAGPqQf3RB2q-d2Awp_-x-Ur6aOxTUwnApt-vm-iTtceZxYnePg@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| contrib/postgres_fdw/deparse.c | modified | +1 −1 |
| src/backend/utils/adt/format_type.c | modified | +19 −11 |
| src/test/regress/expected/create_type.out | modified | +20 −0 |
| src/test/regress/sql/create_type.sql | modified | +6 −0 |
Discussion
- change in behaviour for format_type() call 6 messages · 2018-03-01 → 2018-03-02