Re: Bad (null) varchar() external representation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bad (null) varchar() external representation
Дата
Msg-id 12169.979239194@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Bad (null) varchar() external representation  (Justin Clift <aa2@bigpond.net.au>)
Список pgsql-sql
Justin Clift <aa2@bigpond.net.au> writes:
> "Bad (null) varchar() external representation"

This is a known stupidity in 7.0.* and before: length(varchar) doesn't
like NULLs:

play=> select length(null::varchar);
ERROR:  Bad (null) varchar() external representation

It's fixed for 7.1.  If it's really bothering you in 7.0.*, find that
error string in src/backend/utils/adt/varchar.c and change the code to
return 0 instead of raising an error for NULL input.

But, as someone else pointed out, the constraint expressions you are
using are redundant anyway, given the declared column length limits.
Getting rid of the constraints might be your easiest workaround for now.
        regards, tom lane


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

Предыдущее
От: "Sharmad Naik"
Дата:
Сообщение: postmaster
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Possible bug? WAS :Bad (null) varchar() external representation.