Unable to convert date to tm

From: "Jeff MacDonald" <jeff(at)interchange(dot)ca>
To: "Darren Ferguson" <darren(at)crystalballinc(dot)com>
Cc: "Postgres List" <pgsql-general(at)postgresql(dot)org>
Subject: Unable to convert date to tm
Date: 2002-10-09 15:06:42
Message-ID: HIEGJGDMNIKAMPPDEKBNEEIBCCAA.jeff@interchange.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Just giving the thread a topic.. forgot the first time.

> -----Original Message-----
> From: Darren Ferguson [mailto:darren(at)crystalballinc(dot)com]
> Sent: Wednesday, October 09, 2002 10:46 AM
> To: Jeff MacDonald
> Cc: Postgres List
> Subject: Re: [GENERAL]
>
>
> Yep weird using 7.2.1 and none work on the machine as seen below
>
> oss=> create table test (id integer, birthdate date);
> CREATE
> oss=> insert into test values (343,'1930-04-27');
> INSERT 1283350 1
> oss=> insert into test values (345,'1963-09-15');
> INSERT 1283351 1
> oss=> SELECT id,birthdate FROM users WHERE id IN (343,345);
> ERROR: Attribute 'id' not found
> oss=> SELECT id,birthdate FROM test WHERE id IN (343,345);
> id | birthdate
> -----+------------
> 343 | 1930-04-27
> 345 | 1963-09-15
> (2 rows)
>
> oss=> SELECT age('1995-01-01',birthdate) FROM test where id = 343;
> ERROR: Unable to convert date to tm
> oss=> SELECT age('1995-01-01',birthdate) FROM test where id = 345;
> ERROR: Unable to convert date to tm
> oss=> select version();
> version
> -------------------------------------------------------------
> PostgreSQL 7.2.1 on i686-pc-linux-gnu, compiled by GCC 2.96
> (1 row)
>
> Definately weird
>
>
> On Wed, 9 Oct 2002, Jeff MacDonald wrote:
>
> > Hi Folks,
> >
> > This problem is occuring on pgsql 7.2.1 as well as 7.2.2.
> > I have nothing to say except this is VERY weird. Is there something
> > evil about 1930-04-27 ?
> >
> > xxx=>SELECT id,birthdate FROM users WHERE id IN (343,345);
> > id | birthdate
> > -----+------------
> > 343 | 1930-04-27
> > 345 | 1963-09-15
> > (2 rows)
> >
> > xxx=> SELECT age('1995-01-01',birthdate) FROM users where id =343;
> > ERROR: Unable to convert date to tm
> > xxx=> SELECT age('1995-01-01',birthdate) FROM users where id =345;
> > age
> > -------------------------------
> > 31 years 3 mons 16 days 01:00
> > (1 row)
> >
> >
> >
> > ---
> > Jeff MacDonald
> > Interchange Technologies
> > jeff(at)interchange(dot)ca
> > ---
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 4: Don't 'kill -9' the postmaster
> >
>
> --
> Darren Ferguson
>

In response to

  • Re: at 2002-10-09 14:46:19 from Darren Ferguson

Browse pgsql-general by date

  From Date Subject
Next Message Patrick Fiche 2002-10-09 15:09:34 Re:
Previous Message Darren Ferguson 2002-10-09 14:46:19 Re: