Re: Oracle-compatible lpad/rpad behavior - Mailing list pgsql-general

From Andrew Nosenko
Subject Re: Oracle-compatible lpad/rpad behavior
Date
Msg-id 20001208093346.A1745@bcs.zp.ua
Whole thread Raw
In response to Re: Oracle-compatible lpad/rpad behavior  ("Jonathan Ellis" <jellis@advocast.com>)
List pgsql-general
Jonathan Ellis wrote:
: > Also, what happens if the specified length is less than zero?  Error,
: > or is it treated as zero?
:
: SQL> select ':' || lpad('abcd', -1, 'foobar') || ':' from dual;
:
: ':
: --
: ::
:
: (colons added so it's obvious that it's a zero-length string)

Returns not empty string but NULL:

SQL> select nvl(lpad('abcd', -1, 'foobar'), 'Null') from dual;

NVL(
----
Null

--
Andrew W. Nosenko    (awn@bcs.zp.ua)

pgsql-general by date:

Previous
From: Juriy Goloveshkin
Date:
Subject: ilike and --enable-multibyte=KOI8
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: UNION within VIEW workarounds?