Re: using arrays within structure in ECPG

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: using arrays within structure in ECPG
Дата
Msg-id CAHyXU0zUQeHtgVCWjJzYzhpN8u-96_8-cw-4eK+fwB_RiJRfog@mail.gmail.com
обсуждение исходный текст
Ответ на Re: using arrays within structure in ECPG  (Michael Meskes <meskes@postgresql.org>)
Список pgsql-hackers
On Tue, Apr 1, 2014 at 11:50 AM, Michael Meskes <meskes@postgresql.org> wrote:
> Hi Ashutosh,
>
>> I tried to fix the offset problem. PFA the patch. It does solve the
>> problem of setting wrong offset in ECPGdo() call.
>
> Thanks, looks correct to me.
>
>> But then there is problem of interpreting the result from server as an
>> array within array of structure. The problem is there is in
>> ecpg_get_data(). This function can not understand that the "field" is an
>> array of integers (or for that matter array of anything) and store all
>> the values in contiguous memory at the given address.
>
> I guess I know where that comes from, without actually looking at the
> code, though. Nested arrays are not supported by ecpg and the
> precompiler spits out an error message, just check preproc/type.c.
> However, in your example you have the struct essantially sandwiched
> between the arrays and the (too) simple check in that file doesn't
> notice, but because the implementation is nevertheless lacking.
>
> I'm sorry, but this sounds like a missing feature bug.

Small aside:

I've often wondered if the right long term approach is to abstract
backend type code into a shared library that both the server and
(optionally) the client would link with.  That would make extending
support to exotic types in ecpg much easier.

merlin



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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: json/jsonb/hstore operator precedence
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Including replication slot data in base backups