pgsql: Include typmod when complaining about inherited column type mism - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Include typmod when complaining about inherited column type mism
Date
Msg-id E1aCtmx-00069D-SK@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Include typmod when complaining about inherited column type mismatches.

MergeAttributes() rejects cases where columns to be merged have the same
type but different typmod, which is correct; but the error message it
printed didn't show either typmod, which is unhelpful.  Changing this
requires using format_type_with_typemod() in place of TypeNameToString(),
which will have some minor side effects on the way some type names are
printed, but on balance this is an improvement: the old code sometimes
printed one type according to one set of rules and the other type according
to the other set, which could be confusing in its own way.

Oddly, there were no regression test cases covering any of this behavior,
so add some.

Complaint and fix by Amit Langote

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/fec1ad94dfc5ddacfda8d249bf4b3c739da8f7a1

Modified Files
--------------
src/backend/commands/tablecmds.c          |   12 ++++++++----
src/test/regress/expected/alter_table.out |   21 +++++++++++++++++++++
src/test/regress/sql/alter_table.sql      |   11 +++++++++++
3 files changed, 40 insertions(+), 4 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix brin_summarize_new_values() to check index type and ownershi
Next
From: Alvaro Herrera
Date:
Subject: pgsql: Add forgotten CHECK_FOR_INTERRUPT calls in pgcrypto's crypt()