Skip site navigation (1) Skip section navigation (2)

Re: select query on Dates stored as varchar

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: Yosef Haas <yosef(at)karatedepot(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: select query on Dates stored as varchar
Date: 2010-08-30 21:09:23
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
2010/8/30 Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>:
> On Mon, Aug 30, 2010 at 2:53 PM, Yosef Haas <yosef(at)karatedepot(dot)com> wrote:
>> I know it would be best to change the data type of the column (I didn't
>> initially create the table), but doing so would be require changes to
>> several application that use it and I'd like to avoid that if possible.
> 1. Most of those changes would involve chain saw type work on those
> apps, i.e. cutting out huge chunks of logic in the app to deal with
> the insanity of a text type storing a timestamp or date in 18
> different ways.
> 2. Any new app written now gets inherit the insanity of having to deal
> with the 18 crazy ways a date / timestamp can get entered into the
> system.
> 3. In the future, after converting, math is simple:
>  where timestampfield between now()-interval '2 days' and now()
> and so on.
> Trust me, in the long run, you'll be thankful to have the right data
> type in there, and your applications will tend to do the right thing.

sure +1


> --
> To understand recursion, one must first understand recursion.

In response to

pgsql-general by date

Next:From: Carlos Henrique ReimerDate: 2010-08-30 21:20:54
Subject: Re: Restore referencial integrity
Previous:From: Pavel StehuleDate: 2010-08-30 21:08:20
Subject: Re: select query on Dates stored as varchar

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group