NetBSD/dtime_t

Started by Michael Meskesabout 18 years ago5 messageshackers
Jump to latest
#1Michael Meskes
meskes@postgresql.org

Could anyone please tell me how NetBSD defines dtime_t? We have a
buildfarm failure on canary. I know which change triggered this. I
enabled

typedef timestamp dtime_t;

Which was mishandled by ecpg in Informix mode before and didn't work at
all if you were using the data type.

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 VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL!

#2Kris Jurka
books@ejurka.com
In reply to: Michael Meskes (#1)
Re: NetBSD/dtime_t

On Fri, 15 Feb 2008, Michael Meskes wrote:

Could anyone please tell me how NetBSD defines dtime_t? We have a
buildfarm failure on canary.

/usr/include/sys/types.h says:

typedef int32_t dtime_t; /* on-disk time_t */

Kris Jurka

#3Michael Meskes
meskes@postgresql.org
In reply to: Kris Jurka (#2)
Re: NetBSD/dtime_t

On Fri, Feb 15, 2008 at 05:07:17PM -0500, Kris Jurka wrote:

Could anyone please tell me how NetBSD defines dtime_t? We have a
buildfarm failure on canary.

/usr/include/sys/types.h says:

typedef int32_t dtime_t; /* on-disk time_t */

Thanks. I wonder why they define this datatype. I didn't find it on any
other architecture.

Anyway, does anyone have a suggestion how to solve this issue? Informix
uses the dtime_t datatype to store a timestamp. pgtypeslib also defines
a timestamp type which is 64 bit and not 32 bit like the NetBSD one.
Informix compatibility now typedefs dtime_t to timestamp so the
functions with Informix syntax work as advertized.

If I do not define this datatype, Informix compatibility will not work,
if I define it, NetBSD is not able to compile to regression tests. Of
course we can work around the regression test problem, but a user using
the Informix compatibility feature on NetBSD will run into the same
problem.

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 VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL!

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Michael Meskes (#3)
Re: NetBSD/dtime_t

Michael Meskes <meskes@postgresql.org> writes:

Anyway, does anyone have a suggestion how to solve this issue? Informix
uses the dtime_t datatype to store a timestamp. pgtypeslib also defines
a timestamp type which is 64 bit and not 32 bit like the NetBSD one.
Informix compatibility now typedefs dtime_t to timestamp so the
functions with Informix syntax work as advertized.

Does it have to be a typedef, rather than a #define?
I'm thinking that you could forcibly include sys/types.h
and then it would be safe to #define dtime_t the way you want.

regards, tom lane

#5Michael Meskes
meskes@postgresql.org
In reply to: Tom Lane (#4)
Re: NetBSD/dtime_t

On Sat, Feb 16, 2008 at 09:15:24AM -0500, Tom Lane wrote:

Does it have to be a typedef, rather than a #define?
I'm thinking that you could forcibly include sys/types.h
and then it would be safe to #define dtime_t the way you want.

I just committed a patch that does more or less what you suggest.
Instead of #define'ing dtimt_t I let ecpg handle this. this actually is
code that was part of ecpg before I just put it back in and changed the
other header files some. Let's see if this helps.

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 VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL!