Re: BUG #5748: Invalid oidvector data during binary recv

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #5748: Invalid oidvector data during binary recv
Дата
Msg-id 16687.1289841866@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #5748: Invalid oidvector data during binary recv  (Greg Stark <gsstark@mit.edu>)
Список pgsql-bugs
Greg Stark <gsstark@mit.edu> writes:
> Is this the same question as split() on enmpty strings? Do we have a
> problem distinguishing between a 0-dimensional array and a
> 1-dimensional empty array?

Internally they're certainly different.  I've just been sniffing around
the code a bit, and the main problem I see with trying to be more
rigorous about this is that array_out just prints '{}' for any
zero-element array, regardless of the recorded dimensionality.  We could
reserve that notation to mean a 0-D array (which is what array_in reads
it as).  But then we have to figure out what to print for other cases.
The only good idea that comes to mind is
    [1:0]={}
(or variants of that depending on what the stored dimensions actually
are).  array_in currently rejects that:

regression=# select '[1:0]={}'::int[];
ERROR:  upper bound cannot be less than lower bound

but perhaps it wouldn't be too painful to tweak it to allow the case.

It appears to be fairly hard to actually get a non-zero-D empty array
into the system, so while this is pretty ugly I think it wouldn't affect
common usage.

Comments?

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: BUG #5748: Invalid oidvector data during binary recv
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Bug in concurrency control in temporary GiST indexes