Thread: Default 'timestamp' value on HP-UX running Postgresql6.3.2

Default 'timestamp' value on HP-UX running Postgresql6.3.2

From
"Sangeeta Rao"
Date:
I am running postgres 6.3.2 on HP_UX 10.2. I have a field defined as
type 'timestamp' and am using ISO datestyle. The default value shows
up as the string constant 'epoch'. Is there any way of having the numeric
value of '1970-01-01 00:00:00+00'  returned instead??

I appreciate any help! Thanks.
-sr



Re: [GENERAL] Default 'timestamp' value on HP-UX running Postgresql6.3.2

From
Sferacarta Software
Date:
Hello Sangeeta,

martedì, 29 settembre 98, you wrote:

SR> I am running postgres 6.3.2 on HP_UX 10.2. I have a field defined as
SR> type 'timestamp' and am using ISO datestyle. The default value shows
SR> up as the string constant 'epoch'. Is there any way of having the numeric
SR> value of '1970-01-01 00:00:00+00'  returned instead??

SR> I appreciate any help! Thanks.
SR> -sr

I don't know if there's a more intelligent way to solve this problem
but I had the same problem and I solve this by my self by modifying
the file: postgresql-6.3.2/src/backend/utils/adt/timestamp.c and
re-install PostgreSQL.

.....
     29         char            zone[MAXDATELEN + 1],
     30                            *tzn = zone;
     31
     32         switch (timestamp)
     33         {
     34 /*remark the following 3 lines to have dates as '1970-01-01 00:00:00+00' instead of 'epoch'
     35                 case EPOCH_ABSTIME:
     36                         strcpy(buf, EPOCH);
     37                         break;
     38 */
     39                 case INVALID_ABSTIME:
     40                         strcpy(buf, INVALID);
.....

I hope this help you
      Jose'