Re: interval behaviour

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: interval behaviour
Date: 2005-12-01 19:25:25
Message-ID: 1133465123.16010.59.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2005-12-01 at 12:08, Tom Lane wrote:
> Scott Marlowe <smarlowe(at)g2switchworks(dot)com> writes:
> > Reading through the sql2003 spec, it would appear that the "proper" way
> > to represent an interval would be:
>
> > interval '10' day
>
> This is not actually implemented. The bizarre special-purpose syntax
> the spec requires for datetime literals was something that was on Tom
> Lockhart's to-do list, but when he got bored and left the project,
> nobody else picked it up. I'm not entirely certain how much work
> remains to handle the spec syntax. In the real world, the form we
> do support is a lot better (can you imagine trying to programmatically
> insert interval parameter values into a statement using the spec's
> syntax? Yech.)

Actually, I too prefer PostgreSQL's syntax. It's the worrisome
behaviour of swallowing the spec syntax but not giving the right answer
that scares me. Would it be very hard to have it just return an error
in that case? Rather an error than the wrong answer.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-12-01 19:31:23 Re: interval behaviour
Previous Message Tom Lane 2005-12-01 19:24:23 Re: information_schema._pg_keypositions() in 8.1???