Re: [BUGS] Re: Problems with avg on interval data type - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [BUGS] Re: Problems with avg on interval data type
Date
Msg-id Pine.LNX.4.30.0105190248311.900-100000@peter.localdomain
Whole thread Raw
In response to Re: Problems with avg on interval data type  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane writes:

> I suggest that the current code is more correct than you think ;-).
> ISTM it is a good idea to require a units field, or at least some
> punctuation giving a clue about units --- for example I do not object to
> '08:00' being interpreted as hours and minutes.  But I would be inclined
> to reject all four of the forms '+8', '-8', '8.0', and '8' as ambiguous.
> Is there something in the SQL spec that requires us to accept them?

Our interval is quite a bit different from the SQL version.  In SQL, an
interval value looks like this:

INTERVAL -'5 12:30:15.3' DAY TO SECOND

The unit qualifier is required.  Consequentially, I would reject anything
without units, except '0' maybe.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Plans for solving the VACUUM problem
Next
From: Tom Lane
Date:
Subject: Re: Plans for solving the VACUUM problem