Обсуждение: Bug #463: Make 'infinity' work with type 'date'
Dax Kelson (dax@gurulabs.com) reports a bug with a severity of 3 The lower the number the more severe it is. Short Description Make 'infinity' work with type 'date' Long Description CREATE TABLE test ( somedate date NOT NULL DEFAULT 'infinity' ); ERROR: Unrecognized date external representation of 'infinity' But, CREATE TABLE test ( somedate timestamp NOT NULL DEFAULT 'infinity' ); Works. Sample Code No file was uploaded with this report
Can someone comment on this? The problem appears in current sources: test=> INSERT INTO a VALUES ('infinity'); ERROR: Unrecognized date external representation 'infinity' Is there a reason we support "infinity" in timestamp and not date? > Dax Kelson (dax@gurulabs.com) reports a bug with a severity of 3 > The lower the number the more severe it is. > > Short Description > Make 'infinity' work with type 'date' > > Long Description > CREATE TABLE test ( somedate date NOT NULL DEFAULT 'infinity' ); > ERROR: Unrecognized date external representation of 'infinity' > > But, > > CREATE TABLE test ( somedate timestamp NOT NULL DEFAULT 'infinity' ); > > Works. > > > Sample Code > > > No file was uploaded with this report > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
> Can someone comment on this? The problem appears in current sources: And for every Postgres release since 1989... > test=> INSERT INTO a VALUES ('infinity'); > ERROR: Unrecognized date external representation 'infinity' > Is there a reason we support "infinity" in timestamp and not date? Sure. Timestamp features were based on abstime features (at least partly to support conversions to the newer type), and date features are from date. "Infinity" for timestamp (or date) is not as compelling as it is for abstime, which has a very limited range. I've been a fan of those nifty features, but am not sure they are really necessary now that PostgreSQL supports NULLs for pass by value types and supports a wider range in the timestamp type (date has always had a wide range). - Thomas