Thread: New string functions; initdb required

New string functions; initdb required

From
Thomas Lockhart
Date:
I've just committed changes which implement three SQL99 functions and
operators. OVERLAY() allows substituting a string into another string,
SIMILAR TO is an operator for pattern matching, and a new variant of
SUBSTRING() accepts a pattern to match.

Regression tests have been augmented and pass. Docs have been updated.
The system catalogs were updated, so it is initdb time. Details from the
cvs log below...
                    - Thomas

Implement SQL99 OVERLAY(). Allows substitution of a substring in a
string.
Implement SQL99 SIMILAR TO as a synonym for our existing operator "~".
Implement SQL99 regular expression SUBSTRING(string FROM pat FOR
escape).Extend the definition to make the FOR clause optional.Define textregexsubstr() to actually implement this
feature.
Update the regression test to include these new string features.All tests pass.
Rename the regular expression support routines from "pg95_xxx" to
"pg_xxx".
Define CREATE CHARACTER SET in the parser per SQL99. No implementation
yet.


Re: New string functions; initdb required

From
Tom Lane
Date:
Thomas Lockhart <lockhart@fourpalms.org> writes:
> I've just committed changes which implement three SQL99 functions and
> operators.

I'm getting

gcc -O1 -Wall -Wmissing-prototypes -Wmissing-declarations -g -I../../../../src/include   -c -o regexp.o regexp.c
regexp.c: In function `textregexsubstr':
regexp.c:314: warning: unused variable `result'

The code seems to be rather undecided about whether it intends to return
NULL or an empty string --- would you make up your mind and remove the
other case entirely?
        regards, tom lane


Re: New string functions; initdb required

From
Tom Lane
Date:
Also, you neglected to add PLACING to the gram.y keyword category lists.

(Perhaps someone should whip up a cross-checking script to verify that
everything known to keywords.c is listed exactly once in those gram.y
lists.)
        regards, tom lane


Re: New string functions; initdb required

From
Thomas Lockhart
Date:
> Also, you neglected to add PLACING to the gram.y keyword category lists.

OK. I'm also tracking down what seems to be funny business in the regex
pattern caching logic, so will have a couple of things to fix sometime
soon.
                - Thomas


Re: New string functions; initdb required

From
Thomas Lockhart
Date:
> Also, you neglected to add PLACING to the gram.y keyword category lists.

I just now added and committed it as a reserved word.
                   - Thomas