From: Peter Koczan <pjkoczan@gmail.com>
To: Roberto Garcia <roberto.garcia@cptec.inpe.br>
Cc: pgsql-admin@postgresql.org, "Steve Crawford" <scrawford@pinpointresearch.com>
Subject: Re: Major upgrade advice
Date: Sat, 28 Jun 2008 14:27:57 -0500
Message-ID: <4544e0330806281227y21773c99ja0dbce9fb74be302@mail.gmail.com> (raw)
In-Reply-To: <48595B63.4080000@cptec.inpe.br>
References: <48594429.7040001@pinpointresearch.com>
<48595B63.4080000@cptec.inpe.br>
On Wed, Jun 18, 2008 at 2:00 PM, Roberto Garcia
<roberto.garcia@cptec.inpe.br> wrote:
> Just to mention one issue we had here:
>
> In 8.1 we did this to retrieve all data from a specific date:
> SELECT * FROM xxx
> WHERE <timestamp_column> LIKE '2008-05-20%'
>
> In 8.3 we had to change to:
> SELECT * FROM xxx
> WHERE <timestamp_column> >= CAST('2008-05-20' as timestamp) AND
> <timestamp_column> < CAST('2008-05-21' as timestamp)
Also, don't forget that bareword numbers don't automatically cast to
text anymore.
For instance, assuming col is a text type (char, varchar, text), the query
select * from table where col = 1000
Will throw an error in 8.3 whereas it will work under pre-8.3
releases. You can one either of the following to make it work.
select * from table where col = 1000::text
select * from table where col = '1000'
I've been bitten by that bug a few times.
Peter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: pjkoczan@gmail.com, roberto.garcia@cptec.inpe.br, scrawford@pinpointresearch.com
Subject: Re: Major upgrade advice
In-Reply-To: <4544e0330806281227y21773c99ja0dbce9fb74be302@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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