Re: [HACKERS] [GENERAL] workaround for lack of REPLACE() function - Mailing list pgsql-patches

From Tom Lane
Subject Re: [HACKERS] [GENERAL] workaround for lack of REPLACE() function
Date
Msg-id 5538.1029306222@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] [GENERAL] workaround for lack of REPLACE() function  (Joe Conway <mail@joeconway.com>)
List pgsql-patches
Joe Conway <mail@joeconway.com> writes:
> The only remaining problem is that this causes opr_sanity to fail based
> on this query: ...
> This fails because I implemented text_substr() and bytea_substr() to
> take either 2 or 3 args. This was necessary for SQL92 spec compliance.

Rather than loosening the opr_sanity test, I'd suggest setting this
up as two separate builtin functions.  They can call a common
implementation routine if you like.  But a runtime test on the number
of arguments doesn't offer any attractive improvement.

> I'm planning to take on the replace function next.

Isn't Gavin on that already?

            regards, tom lane

pgsql-patches by date:

Previous
From: Joe Conway
Date:
Subject: Re: [HACKERS] [GENERAL] workaround for lack of REPLACE() function
Next
From: Joe Conway
Date:
Subject: Re: [HACKERS] [GENERAL] workaround for lack of REPLACE() function