replace() using NULL

From: Susanne Holzgraefe <miracee(at)web(dot)de>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: replace() using NULL
Date: 2022-04-13 08:38:28
Message-ID: 29A17362-1756-422E-9BD3-2CBE9F8C990F@web.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello,

tested by using postgresql 13.5:

SELECT REPLACE('xyz‘, ’y’, ’a’); => xaz => expected
SELECT REPLACE('xyz', 'a‘, 'b‘); => xyz => expected

SELECT REPLACE('xyz‘, 'a‘, NULL); => NULL

Also tested by using MariaDB. Same behavior like in PG.
Tested with Oracle, result is ‚xyz‘.

That is what I would expect because xyz includes no a.

I neither can find any documentation about this nor a bug report.

Regards,

miracee (Susanne)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Julien Rouhaud 2022-04-13 11:34:29 Re: replace() using NULL
Previous Message Tom Lane 2022-04-12 21:40:05 Re: BUG #17462: Invalid memory access in heapam_tuple_lock