Re: [PATCH] regexp_positions ( string text, pattern text, flags text ) → setof int4range[]

From: "Joel Jacobson" <joel(at)compiler(dot)org>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Mark Dilger" <mark(dot)dilger(at)enterprisedb(dot)com>, "Postgres hackers" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "Andreas Karlsson" <andreas(at)proxel(dot)se>, "David Fetter" <david(at)fetter(dot)org>
Subject: Re: [PATCH] regexp_positions ( string text, pattern text, flags text ) → setof int4range[]
Date: 2021-03-02 12:41:09
Message-ID: 5eae8911-241a-4432-accc-80e6ffecedfa@www.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 2, 2021, at 06:31, Tom Lane wrote:
>"Joel Jacobson" <joel(at)compiler(dot)org> writes:
>> Unless fixed, then the way I see it, I don't think we can use int4range[] for regexp_positions(),
>
>Yeah. It's a cute idea, but the semantics aren't quite right.

I think there is a case to allow creating empty ranges *with* bounds information, e.g. '[6,7)'::int4range,
as well as the current only possibility to create empty ranges *without* bounds information, e.g. 'empty'::int4range

I've had a look at how ranges are implemented,
and I think I've found a way to support this is a simple non-invasive way.

I've outlined the idea in a patch, which I will send separately,
as it's a different feature, possibly useful for purposes other than regexp_positions().

/Joel

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2021-03-02 12:48:28 Re: buildfarm windows checks / tap tests on windows
Previous Message Dilip Kumar 2021-03-02 12:22:23 Re: [Patch] ALTER SYSTEM READ ONLY