Forum OpenACS Development: Response to Date arithmetic in Oracle and Postgres, and daylight savings time (ugh)

First of all, this would be an excellent issue to raise with the PG developer's group.  Interval arithmetic in PG has been moving towards being more standards compliant.  This might be an area where the standard does something "funny" and PG correctly implements it, or it could be an area where PG is doing something nonstandard.

Definitely worth asking about, though.  I know that interval arithmetic isn't 100% correct at the moment but am uncertain of the details...

It does make sense, more or less.  Adding "1 day" is the same as adding "24 hours", which is a day after all.  Yet, you could argue that it should only bump the day, and leave the rest of the timestamp alone.  In different contexts, either behavior will be confusing.

One way to deal with this would be to strip out the year/month/day portion, bump it by a day, and add the hour/minute/second portion back  in.  Ugly, but it could be done in a PL/pgSQL routine we could make available globally and it would survive fixing of this bug (if it is a bug, which it might or might not be).