Re: 7.2 -> 7.3 incompatibility

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.2 -> 7.3 incompatibility
Date: 2003-02-10 19:13:12
Message-ID: Pine.LNX.4.44.0302101526360.6138-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Christopher Kings-Lynne writes:

> I found an example of a casting problem in our source code now that we're
> running 7.3:
>
> SELECT CURRENT_DATE - EXTRACT(DOW FROM CURRENT_DATE);

A mathematically sound way to write this would be:

select current_date - extract(dow from current_data) * interval '1 day';

> I'm not sure really why DOW needs to be double precision, but hey...

Extract returns double precision. It can't morph itself based on the
argument type at run time.

--
Peter Eisentraut peter_e(at)gmx(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-02-10 19:13:19 Re: pg_dump is broken by recent privileges changes
Previous Message Peter Eisentraut 2003-02-10 19:12:44 Re: PGP signing releases