Skip to content

Add extractAllGroups{Horizontal,Vertical}, regexpQuoteMeta, splitByRegexp#16

Open
serprex wants to merge 1 commit intomainfrom
more-functions
Open

Add extractAllGroups{Horizontal,Vertical}, regexpQuoteMeta, splitByRegexp#16
serprex wants to merge 1 commit intomainfrom
more-functions

Conversation

@serprex
Copy link
Copy Markdown
Member

@serprex serprex commented May 7, 2026

@theory pointed out some missed functions

@serprex serprex requested a review from theory May 7, 2026 14:42
Copy link
Copy Markdown
Contributor

@theory theory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment thread src/pg_re2.c
Comment on lines +211 to +221
static Datum
span_to_text_datum(re2_span s)
{
return PointerGetDatum(span_to_text(s));
}

static Datum
span_to_bytea_datum(re2_span s)
{
return PointerGetDatum(span_to_bytea(s));
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use the existing functions? These wrappers seem superfluous.

Comment thread src/pg_re2.c
Comment on lines +262 to +265
* Escape regex metacharacters per ClickHouse semantics:
* \0 \\ | ( ) ^ $ . [ ] ? * + { : -
* (Slightly differs from re2::RE2::QuoteMeta which uses \xNN for control bytes.)
*/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to ClickHouse source to simplify updating later?

Comment thread src/pg_re2.c
return arr;
}

static ArrayType *
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc comment?

Comment thread test/expected/re2ch.out
(1 row)

-- extractallgroups errors
\set ON_ERROR_STOP off
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be necessary; pg_regress doesn't set this.

Comment thread Makefile
sed -e 's/[[:space:]]*"version":[[:space:]]*"\([^"]*\)",\{0,1\}/\1/')

DATA = sql/$(EXTENSION)--$(EXTVERSION).sql
DATA = $(sort $(wildcard sql/$(EXTENSION)--*.sql))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these need to be sorted, do they?

@theory theory added the enhancement New feature or request label May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants