Re: Problems with avg on interval data type

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: lockhart(at)fourpalms(dot)org, jeremy(at)horizonlive(dot)com, pgsql-bugs(at)postgresql(dot)org, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Problems with avg on interval data type
Date: 2001-05-19 06:21:18
Message-ID: 3B0610DE.774EFFC0@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

> > Single-field signed integers (and unsigned integers?) must be acceptable
> > for a time zone specification (pretty sure this is covered in the SQL
> > spec).
> But surely there is other context cuing you that the number is a
> timezone? In any case, you weren't proposing that interval_in
> should accept '8' as a timezone ...

In the particular case I mentioned, any context is gone by the time the
parser gets beyond gram.y (and that is well before the constant is
evaluated). The general point is that in this case (and perhaps some
other cases) there is a need to convert an interval into a time zone, so
the specification of either or both had better be self consistant.

We do not have an explicit timezone type which could make different
assumptions about units on unadorned integers (and I'd like to avoid
defining a new type for this purpose since SQL9x seems to think that
"interval" should be enough). I'd also like to avoid *requiring* the
full brain damage of SQL9x interval specifications such as Peter
mentioned; we may support it, but should not require it since it is
truely horrid.

- Thomas

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Ondrej Palkovsky 2001-05-19 11:11:47 Failing backend on plpgsql function
Previous Message Tom Lane 2001-05-19 01:14:21 Re: Problems with avg on interval data type

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-05-19 08:06:37 Re: Fix for tablename in targetlist
Previous Message Bruce Momjian 2001-05-19 03:58:52 Re: force of last XID