pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedDates and year 2000
7+ messages / 3 participants
[nested] [flat]
* Dates and year 2000
@ 2002-02-19 18:41 Andy Marden <amarden@usa.net>
2002-02-20 20:37 ` Re: Dates and year 2000 Andy Marden <amarden@usa.net>
0 siblings, 1 reply; 7+ messages in thread
From: Andy Marden @ 2002-02-19 18:41 UTC (permalink / raw)
To: pgsql-sql
Am loading date fields from text in one table to date in another. Format of
the text dates is 'DD.MM.YY', so that's the format mask I use. Dates for
2001 work OK - '02.09.01' translates as '2001-09-02', but '02.09.00'
translates to '0001-09-02 BC'! The y2k.html part of the integrated doc says
that 70 - 69 equates 1970 - 2069.
Am I missing something?
Version 7.1.3 on RH 7.2 BTW
Cheers
Andy
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Dates and year 2000
2002-02-19 18:41 Dates and year 2000 Andy Marden <amarden@usa.net>
@ 2002-02-20 20:37 ` Andy Marden <amarden@usa.net>
2002-02-20 23:21 ` Re: Dates and year 2000 Tom Lane <tgl@sss.pgh.pa.us>
2002-02-21 01:54 ` Re: Dates and year 2000 Thomas Lockhart <lockhart@fourpalms.org>
0 siblings, 2 replies; 7+ messages in thread
From: Andy Marden @ 2002-02-20 20:37 UTC (permalink / raw)
To: pgsql-bugs@postgresql.org
Is this a bug?
"Andy Marden" <amarden@usa.net> wrote in message
news:a4u6fh$orp$1@jupiter.hub.org...
> Am loading date fields from text in one table to date in another. Format
of
> the text dates is 'DD.MM.YY', so that's the format mask I use. Dates for
> 2001 work OK - '02.09.01' translates as '2001-09-02', but '02.09.00'
> translates to '0001-09-02 BC'! The y2k.html part of the integrated doc
says
> that 70 - 69 equates 1970 - 2069.
>
> Am I missing something?
>
> Version 7.1.3 on RH 7.2 BTW
>
> Cheers
>
> Andy
>
>
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Dates and year 2000
2002-02-19 18:41 Dates and year 2000 Andy Marden <amarden@usa.net>
2002-02-20 20:37 ` Re: Dates and year 2000 Andy Marden <amarden@usa.net>
@ 2002-02-20 23:21 ` Tom Lane <tgl@sss.pgh.pa.us>
2002-02-21 07:59 ` Re: Dates and year 2000 Andy Marden <amarden@usa.net>
1 sibling, 1 reply; 7+ messages in thread
From: Tom Lane @ 2002-02-20 23:21 UTC (permalink / raw)
To: Andy Marden <amarden@usa.net>; +Cc: pgsql-bugs@postgresql.org
"Andy Marden" <amarden@usa.net> writes:
> Is this a bug?
Yes. It's fixed in 7.2 ...
regards, tom lane
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Dates and year 2000
2002-02-19 18:41 Dates and year 2000 Andy Marden <amarden@usa.net>
2002-02-20 20:37 ` Re: Dates and year 2000 Andy Marden <amarden@usa.net>
2002-02-20 23:21 ` Re: Dates and year 2000 Tom Lane <tgl@sss.pgh.pa.us>
@ 2002-02-21 07:59 ` Andy Marden <amarden@usa.net>
2002-02-21 09:27 ` Re: Dates and year 2000 Andy Marden <amarden@usa.net>
0 siblings, 1 reply; 7+ messages in thread
From: Andy Marden @ 2002-02-21 07:59 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs@postgresql.org
Do we have a workaround for 7.1.3? I don't really want to risk
an upgrade at this stage in the system
Cheers
Andy
----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "Andy Marden" <amarden@usa.net>
Cc: <pgsql-bugs@postgresql.org>
Sent: Wednesday, February 20, 2002 11:21 PM
Subject: Re: [BUGS] Dates and year 2000
> "Andy Marden" <amarden@usa.net> writes:
> > Is this a bug?
>
> Yes. It's fixed in 7.2 ...
>
> regards, tom lane
>
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Dates and year 2000
2002-02-19 18:41 Dates and year 2000 Andy Marden <amarden@usa.net>
2002-02-20 20:37 ` Re: Dates and year 2000 Andy Marden <amarden@usa.net>
2002-02-20 23:21 ` Re: Dates and year 2000 Tom Lane <tgl@sss.pgh.pa.us>
2002-02-21 07:59 ` Re: Dates and year 2000 Andy Marden <amarden@usa.net>
@ 2002-02-21 09:27 ` Andy Marden <amarden@usa.net>
2002-02-21 14:13 ` Re: Dates and year 2000 Thomas Lockhart <lockhart@fourpalms.org>
0 siblings, 1 reply; 7+ messages in thread
From: Andy Marden @ 2002-02-21 09:27 UTC (permalink / raw)
To: pgsql-bugs@postgresql.org
Just discovered that column::date works fine but to_date(column, 'DD.MM.YY')
causes the problem. I was trying to write portable SQL, but never mind!
Andy
""Andy Marden"" <amarden@usa.net> wrote in message
news:007301c1baad$b60d7b90$0100000a@marden1...
> Do we have a workaround for 7.1.3? I don't really want to risk
> an upgrade at this stage in the system
>
> Cheers
>
> Andy
> ----- Original Message -----
> From: "Tom Lane" <tgl@sss.pgh.pa.us>
> To: "Andy Marden" <amarden@usa.net>
> Cc: <pgsql-bugs@postgresql.org>
> Sent: Wednesday, February 20, 2002 11:21 PM
> Subject: Re: [BUGS] Dates and year 2000
>
>
> > "Andy Marden" <amarden@usa.net> writes:
> > > Is this a bug?
> >
> > Yes. It's fixed in 7.2 ...
> >
> > regards, tom lane
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Dates and year 2000
2002-02-19 18:41 Dates and year 2000 Andy Marden <amarden@usa.net>
2002-02-20 20:37 ` Re: Dates and year 2000 Andy Marden <amarden@usa.net>
2002-02-20 23:21 ` Re: Dates and year 2000 Tom Lane <tgl@sss.pgh.pa.us>
2002-02-21 07:59 ` Re: Dates and year 2000 Andy Marden <amarden@usa.net>
2002-02-21 09:27 ` Re: Dates and year 2000 Andy Marden <amarden@usa.net>
@ 2002-02-21 14:13 ` Thomas Lockhart <lockhart@fourpalms.org>
0 siblings, 0 replies; 7+ messages in thread
From: Thomas Lockhart @ 2002-02-21 14:13 UTC (permalink / raw)
To: Andy Marden <amarden@usa.net>; +Cc: pgsql-bugs@postgresql.org
> Just discovered that column::date works fine but to_date(column, 'DD.MM.YY')
> causes the problem. I was trying to write portable SQL, but never mind!
Portable (as in SQL9x) would be
cast(column as date)
which is also accepted by PostgreSQL...
- Thomas
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Dates and year 2000
2002-02-19 18:41 Dates and year 2000 Andy Marden <amarden@usa.net>
2002-02-20 20:37 ` Re: Dates and year 2000 Andy Marden <amarden@usa.net>
@ 2002-02-21 01:54 ` Thomas Lockhart <lockhart@fourpalms.org>
1 sibling, 0 replies; 7+ messages in thread
From: Thomas Lockhart @ 2002-02-21 01:54 UTC (permalink / raw)
To: Andy Marden <amarden@usa.net>; +Cc: pgsql-bugs@postgresql.org
> Is this a bug?
> > Am loading date fields from text in one table to date in another.
> > Format of the text dates is 'DD.MM.YY', so that's the format mask
> > I use. Dates for 2001 work OK - '02.09.01' translates as
> > '2001-09-02', but '02.09.00' translates to '0001-09-02 BC'!
> > The y2k.html part of the integrated doc says that 70 - 69 equates
> > 1970 - 2069.
> > Am I missing something?
> > Version 7.1.3 on RH 7.2 BTW
What do you mean by "format mask I use"? Are you trying to enter things
like
insert into t1 values (date '02.09.01');
insert into t1 values (date '02.09.00');
...
or are you using to_date() which has the notion of templates or "masks"?
lockhart=# select date '02.09.01';
------------
2001-02-09
lockhart=# select date '02.09.00';
------------
2000-02-09
lockhart=# select version();
-------------------------------------------------------------
PostgreSQL 7.1.2 on i686-pc-linux-gnu, compiled by GCC 2.96
thomas=# select date '02.09.00';
date
------------
2000-02-09
thomas=# select version();
-----------------------------------------------------------
PostgreSQL 7.2 on i686-pc-linux-gnu, compiled by GCC 2.96
So, no bug unless you can be more explicit about your test case...
- Thomas
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2002-02-21 14:13 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-02-19 18:41 Dates and year 2000 Andy Marden <amarden@usa.net>
2002-02-20 20:37 ` Andy Marden <amarden@usa.net>
2002-02-20 23:21 ` Tom Lane <tgl@sss.pgh.pa.us>
2002-02-21 07:59 ` Andy Marden <amarden@usa.net>
2002-02-21 09:27 ` Andy Marden <amarden@usa.net>
2002-02-21 14:13 ` Thomas Lockhart <lockhart@fourpalms.org>
2002-02-21 01:54 ` Thomas Lockhart <lockhart@fourpalms.org>
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