On Fri, 5 Apr 2002, Christopher Kings-Lynne wrote:
> > > 2. Since int4 and abstime are binary compatible (ie
> > int4::abstime works), is
> > > there any serious problem with updating a pg_attribute row for
> > an int4 and
> > > changing it to and abstime? My experiments seem to work.
> >
> > A few integer values are reserved values in abstime, to allow
> > implementation of infinity, -infinity, etc.
>
> Does this mean that hacking the type of an int4 column to become abstime is
> a bad idea?
The only problem with this would be if the int4 column contained the
reserved values:
#define INVALID_ABSTIME ((AbsoluteTime) 0x7FFFFFFE)
#define NOEND_ABSTIME ((AbsoluteTime) 0x7FFFFFFC)
#define NOSTART_ABSTIME ((AbsoluteTime) INT_MIN)
>
> Yes in theory - no in practice?
Kind of the other way around, in my opinion: No in theory, yes in
practice.
Gavin