Re: Error code missing for "wrong length of inner sequence" error - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Error code missing for "wrong length of inner sequence" error
Date
Msg-id B8B72889-D6D7-48FF-B782-D670A6CA4D37@yesql.se
Whole thread Raw
In response to Error code missing for "wrong length of inner sequence" error  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: Error code missing for "wrong length of inner sequence" error  (Heikki Linnakangas <hlinnaka@iki.fi>)
List pgsql-hackers
> On 1 Oct 2020, at 12:54, Heikki Linnakangas <hlinnaka@iki.fi> wrote:

> Most checks when converting between SQL and Python types use the PLy_elog() function, which uses the genericc
ERRCODE_EXTERNAL_ROUTINE_EXCEPTIONerror 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


pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Logical replication CPU-bound with TRUNCATE/DROP/CREATE many tables
Next
From: John Naylor
Date:
Subject: small cleanup: unify scanstr() functions