datetime bug in 6.6.0
Your name : george young
Your email address : gry@ll.mit.edu
System Configuration
---------------------
Architecture (example: Intel Pentium) :pentium(quad xeon actually)
Operating System (example: Linux 2.0.26 ELF) :linux 2.2.11 (SuSE 6.1)
PostgreSQL version (example: PostgreSQL-6.5.1):PostgreSQL-6.6
Compiler used (example: gcc 2.8.0) : gcc version 2.95.1 19990816 (release)
Please enter a FULL description of your problem:
------------------------------------------------
If a datetime value is inserted with zero seconds, it is displayed
with '60' seconds, and minutes just as entered. Aside from being incorrect
on it's face, this prevents dumping and restoring, since a seconds value of 60
is invalid for input.
The problem happens with iso style dates as well as the default, shown below.
Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------
psql pig2a
[PostgreSQL 6.6.0 on i686-pc-linux-gnu, compiled by gcc 2.95.1]
pig2a=> create table foo(d datetime);
CREATE
pig2a=> insert into foo values('1999-jan-23 8:02:00');
INSERT 237044 1
pig2a=> select * from foo;
d
-------------------------------
Sat Jan 23 08:02:60.00 1999 EST
(1 row)
select datetime_part('millisecond',d) from foo;
datetime_part
-------------
1000
(1 row)
pig2a=> insert into foo values('1999-jan-23 8:02:60');
ERROR: Bad datetime external representation '1999-jan-23 8:02:60'
pig2a=> show datestyle;
NOTICE: DateStyle is Postgres with US (NonEuropean) conventions
If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------
Sorry...
From bouncefilter Wed Sep 29 05:45:36 1999
Received: (from news@localhost) by hub.org (8.9.3/8.9.3) id FAA31207;
Wed, 29 Sep 1999 05:20:53 -0400 (EDT) (envelope-from news)
X-Authentication-Warning: hub.org: news set sender to <news> using -f
From: "David Godin" <godind@REMOVE_THIS.voxco.com>
X-Newsgroups: comp.databases.postgresql.announce,
comp.databases.postgresql.bugs, comp.databases.postgresql.docs,
comp.databases.postgresql.hackers,
comp.databases.postgresql.interfaces,
comp.databases.postgresql.patches,
comp.databases.postgresql.ports, comp.databases
Subject: Installing PostgreSQL
Lines: 129
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0013_01BF0378.CD300B60"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Message-ID: <fvvF3.295$I6.8383@typ12.nn.bcandid.com>
X-Trace: typ12.nn.bcandid.com 937854027 209.104.83.107 (Mon,
20 Sep 1999 15:00:27 EDT)
Date: Mon, 20 Sep 1999 14:59:55 -0400
To:
pgsql-hackers@postgresql.org.pgsql-announce@postgresql.org.pgsql-bugs@postgresql.org.pgsql-docs@postgresql.org.pgsql-interfaces@postgresql.org.pgsql-patches@postgresql.org.pgsql-ports@postgreSQL.org
This is a multi-part message in MIME format.
------=_NextPart_000_0013_01BF0378.CD300B60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi all,
This is the output of initdb after a clean install of all the 6.5.1-2 =
RPMs
I downloaded from ftp.postgreSQL.org. To install them I did an "rpm -ivh =
post*".
I'm using RedHat 6 on x86 with 64 Meg Ram and 300 Meg of HD space left.
=20
I used "initdb -l /usr/lib/pgsql -r /var/lib/pgsql/data -u postgres -d" =
to=20
initialyse the database (This is what they say in the manual).
Running with debug mode on.
initdb: using /usr/lib/pgsql/local1_template1.bki.source as input to =
create the template database.
initdb: using /usr/lib/pgsql/global1.bki.source as input to create the =
global classes.
initdb: using /usr/lib/pgsql/pg_hba.conf.sample as the host-based =
authentication control file.
We are initializing the database system with username postgres =
(uid=3D104).
This user will own all the files and must also own the server process.
Creating template database in /var/lib/pgsql/data/base/template1
Running: postgres -boot -C -F -D/var/lib/pgsql/data -d template1
initdb: could not create template database
initdb: cleaning up by wiping out /var/lib/pgsql/data/base/template1
This is a "ls -al /var/lib/pgsql"
total 4
drwx------ 3 postgres postgres 1024 Sep 20 14:09 .
drwxr-xr-x 15 root root 1024 Sep 17 11:07 ..
-rw-r--r-- 1 root root 35 Sep 1 00:55 odbcinst.ini
It's obvious i'm doing something wrong! Can someone help me?
David Godin
godind@REMOVE_THIS.voxco.com
------=_NextPart_000_0013_01BF0378.CD300B60
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3401" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>Hi all,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>This is the output of initdb after a =
clean install=20
of all the 6.5.1-2 RPMs</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I downloaded from ftp.postgreSQL.org. =
To install=20
them I did an "rpm -ivh post*".</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D260052718-20091999>I'm =
using RedHat 6=20
on x86 with 64 Meg Ram and 300 Meg of HD space left.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I used "initdb -l /usr/lib/pgsql -r=20
/var/lib/pgsql/data -u postgres -d" to </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>initialyse the database (This is what =
they say in=20
the manual).</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Running with debug mode =
on.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>initdb: using=20
/usr/lib/pgsql/local1_template1.bki.source as input to create the =
template=20
database.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>initdb: using =
/usr/lib/pgsql/global1.bki.source as=20
input to create the global classes.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>initdb: using =
/usr/lib/pgsql/pg_hba.conf.sample as=20
the host-based authentication control file.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>We are initializing the database system =
with=20
username postgres (uid=3D104).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>This user will own all the files and =
must also own=20
the server process.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Creating template database in=20
/var/lib/pgsql/data/base/template1</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Running: postgres -boot -C -F =
-D/var/lib/pgsql/data=20
-d template1</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>initdb: could not create template=20
database</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>initdb: cleaning up by wiping out=20
/var/lib/pgsql/data/base/template1</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>This is a "ls -al =
/var/lib/pgsql"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>total 4</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>drwx------ 3 postgres postgres 1024 Sep =
20 14:09=20
.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>drwxr-xr-x 15 root root 1024 Sep 17 =
11:07=20
..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>-rw-r--r-- 1 root root 35 Sep 1 00:55=20
odbcinst.ini</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>It's obvious i'm doing something wrong! =
Can someone=20
help me?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>David Godin</FONT></DIV><FONT =
face=3DArial>
<DIV><FONT size=3D2><A=20
href=3D"mailto:godind@REMOVE_THIS.voxco.com">godind@REMOVE_THIS.voxco.com=
</A></FONT></FONT></DIV></FONT></DIV></BODY></HTML>
------=_NextPart_000_0013_01BF0378.CD300B60--