Re: using arrays within structure in ECPG

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: Michael Meskes <meskes(at)postgresql(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: using arrays within structure in ECPG
Date: 2014-04-02 04:03:15
Message-ID: CAFjFpRe6dxuCr3i4BqMuPj-AW8qPNp0sa5nsU4-pOfRNxt3VHg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

So, you are saying that we should try to catch such errors and report
during pre-compile time. That's better than silently corrupting the data.

On Tue, Apr 1, 2014 at 10:20 PM, Michael Meskes <meskes(at)postgresql(dot)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.
>
> Michael
> --
> Michael Meskes
> Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
> Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
> Jabber: michael.meskes at gmail dot com
> VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL
>

--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2014-04-02 04:25:19 Re: It seems no Windows buildfarm members are running find_typedefs
Previous Message Tom Lane 2014-04-02 02:05:34 Re: [BUGS] BUG #9518: temporary login failure - "missing pg_hba entry"