Re: Error code missing for "wrong length of inner sequence" error

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Error code missing for "wrong length of inner sequence" error
Date: 2020-10-01 11:21:46
Message-ID: B8B72889-D6D7-48FF-B782-D670A6CA4D37@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 1 Oct 2020, at 12:54, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:

> Most checks when converting between SQL and Python types use the PLy_elog() function, which uses the genericc ERRCODE_EXTERNAL_ROUTINE_EXCEPTION error code, but I think ERRCODE_ARRAY_SUBSCRIPT_ERROR is better.

On that note, wouldn't the dimension check errors in PLySequence_ToArray be
just as well off using normal ereport()'s? Only one of them seem to error out
in a way that could propagate an error from Python to postgres.

> Thoughts? If not, I'm going to add errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR) to that.

+1 on using ERRCODE_ARRAY_SUBSCRIPT_ERROR as it better conveys meaning.

cheers ./daniel

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2020-10-01 12:09:28 small cleanup: unify scanstr() functions
Previous Message Amit Kapila 2020-10-01 11:14:35 Re: Logical replication CPU-bound with TRUNCATE/DROP/CREATE many tables