Re: AW: Oracle-compatible lpad/rpad behavior

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: AW: Oracle-compatible lpad/rpad behavior
Дата
Msg-id 7236.976548778@sss.pgh.pa.us
обсуждение исходный текст
Ответ на AW: Oracle-compatible lpad/rpad behavior  (Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>)
Список pgsql-hackers
Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at> writes:
>> Also, what happens if the specified length is less than zero?  Error,
>> or is it treated as zero?

> Returns NULL in both if length <= 0. I would see the < 0 case as proper,
> but the == 0 case sure looks weird to me.

Since Oracle fails to distinguish NULL from empty string, it's hard to
tell what they have in mind here.  I've implemented it as empty-string
result for length <= 0.  You could possibly make a case for empty string
at length = 0 and NULL for length < 0, but I'm not sure it's worth the
trouble...

            regards, tom lane

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

Предыдущее
От: Zeugswetter Andreas SB
Дата:
Сообщение: suggest remove of elog in xlog.c
Следующее
От: Tom Lane
Дата:
Сообщение: Is VACUUM still crash-safe?