Hi Takahashi-san
> In the case of standard types, ECPG can get oids from pg_type.h.
> However, in the case of user defined types, ECPG needs to access
> pg_type table and it is overhead.
The overhead wouldn't be too bad. In fact it's already done, at least
sometimes. Please check ecpg_is_type_an_array().
> By the way, should we support prepare statement like following?
> (I think yes.)
If the standard allows it, we want to be able to process it.
> ============================
> EXEC SQL PREPARE test_prep (int) AS SELECT id from test_table where
> id = :ID or id =$1;
> ============================
>
> Current ECPG produces following code.
>
> ============================
> ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "prepare \"test_prep\"
> ( int ) as \" select id from test_table where id = $1 or id = $1
> \"",
> ECPGt_int,&(ID),(long)1,(long)1,sizeof(int),
> ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
> ECPGt_EORT);
> ============================
>
>
> In this case, both ":ID" and "$1" in the original statement are
> converted to "$1" and ECPGdo() cannot distinguish them.
> Therefore, ECPG should produce different code.
I agree. It seems that stuff really broke over the years and nobody
noticed, sigh.
Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Meskes at (Debian|Postgresql) dot Org
Jabber: michael at xmpp dot meskes dot org
VfL Borussia! Força Barça! SF 49ers! Use Debian GNU/Linux, PostgreSQL