Re: MySQL search query is not executing in Postgres DB - Mailing list pgsql-hackers

From Robert Haas
Subject Re: MySQL search query is not executing in Postgres DB
Date
Msg-id CA+TgmobR1+M4e6LGkMxHc96CR946i6hfXqb+ShAgGJp8+ZentQ@mail.gmail.com
Whole thread Raw
In response to Re: MySQL search query is not executing in Postgres DB  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: MySQL search query is not executing in Postgres DB  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
On Fri, Feb 17, 2012 at 2:44 PM, Andrew Dunstan <andrew@dunslane.net> wrote:
> Strings of digits used that way should not be stored in numeric fields at
> all, IMNSHO, just as zip codes and phone numbers should not be. They should
> be text in the first place, and if the OP had done that he wouldn't have had
> any difficulty about this. I hope that's what the Lone Ranger would do ...

The argument isn't about whether the user made the right design
choices; it's about whether he should be forced to insert an explicit
type cast to get the query to do what it is unambiguously intended to
do.  I don't believe it's entirely self-evident that it's always
better to store strings of integers in a text column rather than as an
integer or bigint - integers are pretty fast and compact.  Even
granting that a text field would have been better, nobody's arguing
that you can't do LIKE against an integer column; we're just
discussing what syntax is required to make the user's intent
acceptably clear.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: MySQL search query is not executing in Postgres DB
Next
From: Andrew Dunstan
Date:
Subject: Re: MySQL search query is not executing in Postgres DB