> On 1 Oct 2020, at 12:54, Heikki Linnakangas <hlinn...@iki.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