| From: | "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com> |
|---|---|
| To: | Andrew Snow <andrew(at)modulus(dot)org> |
| Cc: | <cmarin(at)dims(dot)com>, <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: A creepy story about dates. How to prevent it? |
| Date: | 2003-06-19 14:08:58 |
| Message-ID: | Pine.LNX.4.33.0306190807340.7044-100000@css120.ihs.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Thu, 19 Jun 2003, Andrew Snow wrote:
>
> This is an old postgres "gotcha" that I've lived with since a long, long
> time ago. It forced me to always use the datestyle YYYY-MM-DD so there
> is never any confusion in my programming.
create table p (d date);
CREATE TABLE
insert into p values ('2003-13-03');
INSERT 4530055 1
insert into p values ('2003-03-13');
INSERT 4530056 1
select * from p;
d
------------
2003-03-13
2003-03-13
That doesn't fix it, it just makes it more obvious to the user how they
should insert. If you switch the month/day pgsql STILL swaps them back
for you.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2003-06-19 14:10:22 | Re: A creepy story about dates. How to prevent it? |
| Previous Message | Greg Stark | 2003-06-19 14:08:24 | Re: Incremental backups, and backup history |