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

2020-10-02 Thread Heikki Linnakangas
On 02/10/2020 15:06, Daniel Gustafsson wrote: On 2 Oct 2020, at 13:44, Heikki Linnakangas wrote: On 01/10/2020 14:21, Daniel Gustafsson wrote: 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

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

2020-10-02 Thread Daniel Gustafsson
> On 2 Oct 2020, at 13:44, Heikki Linnakangas wrote: > > On 01/10/2020 14:21, Daniel Gustafsson wrote: >>> On 1 Oct 2020, at 12:54, Heikki Linnakangas wrote: >>> Most checks when converting between SQL and Python types use the PLy_elog() >>> function, which uses the genericc ERRCODE_EXTERNAL_RO

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

2020-10-02 Thread Heikki Linnakangas
On 01/10/2020 14:21, Daniel Gustafsson wrote: On 1 Oct 2020, at 12:54, Heikki Linnakangas 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_E

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

2020-10-01 Thread Daniel Gustafsson
> On 1 Oct 2020, at 12:54, Heikki Linnakangas 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 th

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

2020-10-01 Thread Heikki Linnakangas
In PLySequence_ToArray_recurse(), there's this check: if (PySequence_Length(list) != dims[dim]) ereport(ERROR, (errmsg("wrong length of inner sequence: has length %d, but %d was expected", (i