Re: MySQL search query is not executing in Postgres DB
От | Robert Haas |
---|---|
Тема | Re: MySQL search query is not executing in Postgres DB |
Дата | |
Msg-id | CA+TgmobR1+M4e6LGkMxHc96CR946i6hfXqb+ShAgGJp8+ZentQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: MySQL search query is not executing in Postgres DB (Andrew Dunstan <andrew@dunslane.net>) |
Ответы |
Re: MySQL search query is not executing in Postgres DB
|
Список | 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 по дате отправления: