ecpg: dtime_t vs timestamp
We have upgraded from Version 7.4.x to Version 8.2.4.
In 7.4.x, we use the Informix compatibility functionality to use legacy
code.
Our .pgc code looks as follows:
#include "Ice.h"
EXEC SQL include sqlda;
EXEC SQL include sqltypes;
EXEC SQL include sql3types;
EXEC SQL include pgtypes_timestamp;
EXEC SQL include pgtypes_date;
EXEC SQL include pgtypes_interval;
EXEC SQL include pgtypes_numeric;
EXEC SQL BEGIN DECLARE SECTION;
struct Ice_t
{
char lid[9];
char pe[3];
short dur;
char ts[3];
char extremum[2];
dtime_t obstime;
double value;
char shef_qual_code[2];
long quality_code;
short revision;
char product_id[11];
dtime_t producttime;
dtime_t postingtime;
}
The Ice.h header file includes the postgres datetime.h header file. The
datetime.h file has the line "typedef timestamp dtime_t". Using Version
7.4.x, this worked. Now when we use Version 8.2.4 (which has an updated
ecpg), this results in the message
ERROR: invalid datatype 'dtime_t'
How should we fix this?
Paul Tilles
On Tue, Aug 28, 2007 at 10:59:42AM -0400, Paul Tilles wrote:
We have upgraded from Version 7.4.x to Version 8.2.4.
In 7.4.x, we use the Informix compatibility functionality to use legacy
code.
Our .pgc code looks as follows:
...
This is indeed a bug. Thanks for reporting it.
What happens is that ecpg defines the data types, but does not use that
define while in C code. I just committed patches to CVS. I also attach
it here. Could you please try if this fixes your problem?
Thanks.
Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!