strpos behavior change around empty substring in PG12

From: Shay Rojansky <roji(at)roji(dot)org>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: strpos behavior change around empty substring in PG12
Date: 2019-10-28 15:02:30
Message-ID: CADT4RqAz7oN4vkPir86Kg1_mQBmBxCp-L_=9vRpgSNPJf0KRkw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greetings hackers,

Before PG12, select strpos('test', '') returns 1 (empty substring found at
first position of the string), whereas starting with PG12 it returns 0
(empty substring not found).

Is this behavior change intentional? If so, it doesn't seem to be
documented in the release notes...

First raised by Austin Drenski in
https://github.com/npgsql/efcore.pg/pull/1068#issuecomment-546795826

Thanks,

Shay

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2019-10-28 15:06:44 Re: update ALTER TABLE with ATTACH PARTITION lock mode
Previous Message Alvaro Herrera 2019-10-28 15:02:20 Re: [PATCH] Do not use StdRdOptions in Access Methods