Re: Adding time to DATE type

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Adding time to DATE type
Date: 2000-06-11 11:41:24
Message-ID: Pine.LNX.4.21.0006110322150.9195-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian writes:

> Can someone give me a TODO summary for this issue?

* make 'text' constants default to text type (not unknown)

(I think not everyone's completely convinced on this issue, but I don't
recall anyone being firmly opposed to it.)

* add SQL interval syntax

> > On Fri, 17 Mar 2000, Bruce Momjian wrote:
> >
> > > test=> SELECT date('1/1/1992') + timespan('1 year');
> >
> > If I may point something out here, the correct syntax for this in SQL92 is
> >
> > SELECT DATE '1/1/1992' + INTERVAL '1 year'
> >
> > (Ignoring the fact that neither the date nor the interval strings have the
> > correct format.)
> >
> > This converts to a cast in PostgreSQL, which is fine, but the standard
> > makes a semantic distinction:
> >
> > CAST('2000-02-29' AS DATE)
> >
> > converts a character literal to date
> >
> > DATE '2000-02-29'
> >
> > *is* a date literal. Furthermore, just
> >
> > '2000-02-29'
> >
> > is not a date literal.
> >
> > I've been doing some lobbying to get rid of the "unknown" type because SQL
> > is perfectly clear about what "quote-stuff-quote" means (character type)
> > and in absence of any evidence to the contrary (such as a function only
> > taking date arguments, inserting it into a date field) it should be
> > treated as such. That will get rid of such embarrassments as
> >
> > SELECT 'a' LIKE 'a' -- try it
> >
> > Tom believes that this will create a pain for the odd data type crowd but
> > I don't think that this is so (or at least has to be so) whereas the
> > current behavior creates a pain for the normal data type crowd.
> >
> > Just my ideas.
> >
> >
> > --
> > Peter Eisentraut Sernanders v?g 10:115
> > peter_e(at)gmx(dot)net 75262 Uppsala
> > http://yi.org/peter-e/ Sweden
> >
> >
>
>
>

--
Peter Eisentraut Sernanders väg 10:115
peter_e(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2000-06-11 11:46:57 C++ disabled by default
Previous Message Peter Eisentraut 2000-06-11 11:41:09 Re: Current initdb broken.