Re: maybe a bug in plpgsql, nulls and empty strings are not the same

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: maybe a bug in plpgsql, nulls and empty strings are not the same
Дата
Msg-id 13013.991065768@sss.pgh.pa.us
обсуждение исходный текст
Ответ на maybe a bug in plpgsql, nulls and empty strings are not the same  (Domingo Alvarez Duarte <domingo@dad-it.com>)
Список pgsql-hackers
Domingo Alvarez Duarte <domingo@dad-it.com> writes:
> When trying write a function in plpgsql I'm getting behavior that
> probably isn't the corect one.

It works as expected if you declare v_sep as varchar rather than char.

I think plpgsql may be interpretingv_sep           char;
as declaring v_sep to be the internal 1-byte "char" type, not char(n)
with unspecified length as you are expecting.  There's definitely
something strange going on with the assignmentv_sep := '''';

In any case it's a tad bizarre to use char rather than varchar for
something that you intend to have varying width, no?
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Oleg Bartunov
Дата:
Сообщение: R-Tree implementation using GiST (compatible with multi-key GiST)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: User functions and AIX