Re: BUG #17477: A crash bug in transformValuesClause()

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

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: krking@zju.edu.cn, pgsql-bugs@lists.postgresql.org
Date: 2022-05-09T15:25:38Z
Lists: pgsql-bugs

Attachments

Masahiko Sawada <sawada.mshk@gmail.com> writes:
> It seems like transformValuesClause() cannot handle properly the value
> clause having a relation that has an empty column. Should we raise an
> error in this case?

Given that we try to support zero-column relations, I'm not sure why
we'd insist on disallowing zero-column VALUES.  I think the problem
is that the code in transformValuesClause needs to be tweaked to
make that work.  The attached quick hack seems to do the trick.

			regards, tom lane

Commits

  1. Fix core dump in transformValuesClause when there are no columns.