• Bruce Momjian's avatar
    Attempting to insert a value of 'now' into a datetime type · c10e6bcb
    Bruce Momjian authored
    results in a bogus datetime value under AlphaLinux.  (Note that
    the link to submit a port-specific bug on your website is broken)
    
    -Test Case:
    ----------
    testdb=> create table dttest (dt datetime);
    testdb=> insert into dttest values ('now');
    
    --------------------------------------------------------------------------
    
    
    Solution:
    ---------
    The basic problem is the typedefs of AbsoluteTime and RelativeTime,
    which are both 'int32'.  These types appear to be used synonymously
    with the 'time_t' type, which on AlphaLinux is typedef'd as a 'long
    int', which is 64-bits (not 32).  The solution included here fixes
    the datetime type (it now passes the regression test), but does not
    pass the absolute and relative time regression tests.  Presumably, a
    more thorough investigation of how these types are used is warranted.
    The included patch is from the v6.3.2 source, but can be applied to
    the v6.4.2 source.  Please note that there is also a RedHat-specific
    patch distributed with the PostgreSQL source package from RedHat
    that was applied first.
    
    Rich Edwards
    c10e6bcb
nabstime.h 4.03 KB