pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Albert REINER <areiner@tph.tuwien.ac.at>
To: PostgreSQL-SQL <pgsql-sql@postgreSQL.org>
Subject: Historical dates in Timestamp
Date: Wed, 4 Apr 2001 13:04:23 +0200
Message-ID: <20010404130423.A2180@frithjof> (raw)

Saluton,

I have a database with dates, some of which are historical dates.
When I wanted to enter May 28th, 812 I got an error message, had to
use 0812 for the year instead:

albert=> CREATE DATABASE test;
CREATE DATABASE
albert=> \c test
You are now connected to database test.
test=> CREATE TABLE dates (d timestamp);
CREATE
test=> insert into dates (d) values ('812-5-28');
ERROR:  Bad timestamp external representation '812-5-28'
test=> insert into dates (d) values ('0812-5-28');
INSERT 81801 1

The same happens for BC dates:

test=> insert into dates (d) values ('812-5-28 BC');
ERROR:  Bad timestamp external representation '812-5-28 BC'
test=> insert into dates (d) values ('0812-5-28 BC');
INSERT 81802 1

Is it really reasonable to enforce that the number of years is four
digits at least?

I'm running:

test=> SELECT version();
                              version
--------------------------------------------------------------------
 PostgreSQL 7.0.2 on i586-pc-linux-gnulibc1, compiled by gcc 2.95.1
(1 row)

Bye,

Albert.



view thread (2+ messages)  latest in thread

Message-ID: <20010404130423.A2180@frithjof>
Permalink:  ../20010404130423.A2180@frithjof/
Also on:    postgresql.org/message-id/20010404130423.A2180@frithjof

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: areiner@tph.tuwien.ac.at
  Subject: Re: Historical dates in Timestamp
  In-Reply-To: <20010404130423.A2180@frithjof>
  References: <20010404130423.A2180@frithjof>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox