ECPG and typedef struct

From: Edmund Bacon <ebacon(at)onesystem(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: ECPG and typedef struct
Date: 2004-01-19 18:31:36
Message-ID: 1074537096.4164.117.camel@elb_lx.onesystem.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Is it still necessary to define SQL TYPEs twice?

eg

typedef struct foo { ... } foo_t;

EXEC SQL TYPE foo_t IS struct foo { ... };

Is there some less maintenance-error-prone way to accomplish this? I
know about the -c option to ecpg, but this doesn't help if I need to
access the defined type from a .c file.

Ideally the C level typedef would be in a .h file somewhere and either
#include-ed or EXEC SQL INCLUDE-ed into .c or .pgc file

Thanks

--
Edmund Bacon <ebacon(at)onesystem(dot)com>

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Christof Petig 2004-01-21 20:40:33 Re: ECPG and EXEC SQL GET DIAGNOSTICS
Previous Message L J Bayuk 2004-01-19 02:38:30 Re: PQsetNoticeReceiver issues