Re: [SQL] Interval subtracting

From: Mark Dilger <pgsql(at)markdilger(dot)com>
To: Hannu Krosing <hannu(at)skype(dot)net>
Subject: Re: [SQL] Interval subtracting
Date: 2006-03-01 20:46:12
Message-ID: 44060814.8030604@markdilger.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches pgsql-sql

Hannu Krosing wrote:
> But unfortunately '2 mons -1 days' <> '1 mons 29 days'
>
> If I want something to happen 1 day less than two months from dome date,
> then the only way to say that consistently *is* '2 mons -1 days'.

Correct me if I am wrong, but I thought that justify_days would only be called
if the user wanted it. I get the following behavior in psql even after the
patch is applied:

select '2 mons -1 days'::interval;
interval
----------------
2 mons -1 days

So there does not seem to be any justification going on without the user's
permission. Consequently, if you need '2 mons -1 days', don't call justify_days.

Am I missing something?

mark

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Kirkwood 2006-03-01 20:50:03 Re: pg_config, pg_service.conf, postgresql.conf ....
Previous Message Mark Dilger 2006-03-01 20:39:30 Re: [SQL] Interval subtracting

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-03-01 20:55:21 Re: [SQL] Interval subtracting
Previous Message Mark Dilger 2006-03-01 20:39:30 Re: [SQL] Interval subtracting

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2006-03-01 20:55:21 Re: [SQL] Interval subtracting
Previous Message Simon Kinsella 2006-03-01 20:41:20 Re: Help with trigger that updates a row prior to a potentially aborted deletion?