Hi!

I work on memory leaks during creation index on time/timestamp column using GiST and found follow problem (?):

For timestamp storage and defines are defined as (from utils/timestamp.h):
#ifdef HAVE_INT64_TIMESTAMP

typedef int64 Timestamp;
#define TimestampGetDatum(X) Int64GetDatum(X)
#define DatumGetTimestamp(X)  ((Timestamp) DatumGetInt64(X))

#else

typedef double Timestamp;
#define TimestampGetDatum(X) Float8GetDatum(X)
#define DatumGetTimestamp(X)  ((Timestamp) DatumGetFloat8(X))

#endif

It looks consistently, but for time (from utils/date.h):

ifdef HAVE_INT64_TIMESTAMP
typedef int64 TimeADT;

#else
typedef float8 TimeADT;
#endif

#define TimeADTGetDatum(X)        Float8GetDatum(X)
#define DatumGetTimeADT(X)        ((TimeADT) DatumGetFloat8(X))

So, in case HAVE_INT64_TIMESTAMP int64 may use as float8.  Is it correct?


It seems to me, that my last changes in btree_gist produce a error for btree_time on some architectures for this reason, but the same changes for timestamp doesn't produce ones.



-- Teodor Sigaev E-mail: [EMAIL PROTECTED] WWW: http://www.sigaev.ru/

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
   (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to