Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-interfaces by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group