| От | Tom Lane |
|---|---|
| Тема | Re: [SQL] plpgsql doesn't coerce boolean expressions to |
| Дата | |
| Msg-id | 23397.1064960812@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: [SQL] plpgsql doesn't coerce boolean expressions to (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-hackers |
I said:
> If we want to preserve this behavior for IF et al, I don't think there
> is any practical way to apply SQL-level type coercion as I had wanted.
> We could instead make the code act like it's assigning to a plpgsql
> boolean variable --- but it will apply plpgsql's textual conversion
> methods, not SQL type coercion.
I have now written and tested the patch for this --- it's doing what I
originally called option 3:
>>> 3. Try to convert nonbooleans to boolean using plpgsql's usual method
>>> for cross-type coercion, ie run the type's output proc to get a
>>> string and feed it to bool's input proc. (This seems unlikely to
>>> avoid throwing an error in very many cases, but it'd be the most
>>> consistent with other parts of plpgsql.)
Unless someone objects, I'll commit this.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера