pgsql: Improve the error message for an inappropriate column definition

Started by Tom Lanealmost 6 years ago4 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Improve the error message for an inappropriate column definition list.

The existing message about "a column definition list is only allowed for
functions returning "record"" could be given in some cases where it was
fairly confusing; in particular, a function with multiple OUT parameters
*does* return record according to pg_proc. Break it down into a couple
more cases to deliver a more on-point complaint. Per complaint from
Bruce Momjian.

Discussion: /messages/by-id/798909.1600562993@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ce90f075f0d831ca4085ba73891b7da2a2f7047e

Modified Files
--------------
src/backend/parser/parse_relation.c | 44 +++++++++++++++++++++++++++-----
src/test/regress/expected/rangefuncs.out | 13 ++++++++++
src/test/regress/sql/rangefuncs.sql | 5 ++++
3 files changed, 55 insertions(+), 7 deletions(-)

#2Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#1)
Re: pgsql: Improve the error message for an inappropriate column definition

On Tue, Sep 22, 2020 at 02:49:22PM +0000, Tom Lane wrote:

Improve the error message for an inappropriate column definition list.

The existing message about "a column definition list is only allowed for
functions returning "record"" could be given in some cases where it was
fairly confusing; in particular, a function with multiple OUT parameters
*does* return record according to pg_proc. Break it down into a couple
more cases to deliver a more on-point complaint. Per complaint from
Bruce Momjian.

Discussion: /messages/by-id/798909.1600562993@sss.pgh.pa.us

Uh, did you not want to backpatch this?

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com

The usefulness of a cup is in its emptiness, Bruce Lee

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#2)
Re: pgsql: Improve the error message for an inappropriate column definition

Bruce Momjian <bruce@momjian.us> writes:

On Tue, Sep 22, 2020 at 02:49:22PM +0000, Tom Lane wrote:

Improve the error message for an inappropriate column definition list.

Uh, did you not want to backpatch this?

No. It's not a bug fix, and it'd add work for translators.

regards, tom lane

#4Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#3)
Re: pgsql: Improve the error message for an inappropriate column definition

On Thu, Sep 24, 2020 at 02:58:49PM -0400, Tom Lane wrote:

Bruce Momjian <bruce@momjian.us> writes:

On Tue, Sep 22, 2020 at 02:49:22PM +0000, Tom Lane wrote:

Improve the error message for an inappropriate column definition list.

Uh, did you not want to backpatch this?

No. It's not a bug fix, and it'd add work for translators.

OK. I guess this wasn't enough of an improvement.

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com

The usefulness of a cup is in its emptiness, Bruce Lee