Re: [SQL] plpgsql doesn't coerce boolean expressions to

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: more i18n/l10n issues
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta)