| От | Shridhar Daithankar |
|---|---|
| Тема | Re: Join on incompatible types |
| Дата | |
| Msg-id | 3FBB62B5.20507@myrealbox.com обсуждение исходный текст |
| Ответ на | Re: Join on incompatible types (Laurent Martelli <laurent@aopsys.com>) |
| Список | pgsql-performance |
Laurent Martelli wrote: >>>>>>"Shridhar" == Shridhar Daithankar <shridhar_daithankar@myrealbox.com> writes: > > > [...] > > Shridhar> 2. Try following query EXPLAIN ANALYZE SELECT * from lists > Shridhar> join classes on classes.id=lists.value where > Shridhar> lists.id='16'::integer; > > Shridhar> classes.id=lists.value::integer. > > With classes.id of type integer and lists.value of type varchar, I get > "ERROR: Cannot cast type character varying to integer", which is not > such a surprise. Try to_numbr function to get a number out of string. Then cast it to integer. http://developer.postgresql.org/docs/postgres/functions-formatting.html I hope that works. Don't have postgresql installation handy here.. Shridhar
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера