]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix error reporting for index expressions of prohibited types.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 17 Dec 2019 22:44:28 +0000 (17:44 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 17 Dec 2019 22:44:28 +0000 (17:44 -0500)
commit298d056d9d9786bac9c645be0011e8229029aa21
treee891ee3e49814935d518157531305aa221f40932
parentcfb2a4cce37bdb279a9360913b3ef29be3079f98
Fix error reporting for index expressions of prohibited types.

If CheckAttributeType() threw an error about the datatype of an
index expression column, it would report an empty column name,
which is pretty unhelpful and certainly not the intended behavior.
I (tgl) evidently broke this in commit cfc5008a5, by not noticing
that the column's attname was used above where I'd placed the
assignment of it.

In HEAD and v12, this is trivially fixable by moving up the
assignment of attname.  Before v12 the code is a bit more messy;
to avoid doing substantial refactoring, I took the lazy way out
and just put in two copies of the assignment code.

Report and patch by Amit Langote.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/CA+HiwqFA+BGyBFimjiYXXMa2Hc3fcL0+OJOyzUNjhU4NCa_XXw@mail.gmail.com
src/backend/catalog/index.c
src/test/regress/expected/create_index.out
src/test/regress/sql/create_index.sql