Just a small optimization would be to use a backreference with regexp_replace
instead of regexp_matches:
select regexp_replace('foobarbaz', '(...)', E'\\1 ', 'g');
regexp_replace
foo bar baz
Great.
After combined with several more replace(s), regexp_replace will provide
On Wed, Jun 20, 2012 at 12:08:24PM -0600, Wes James wrote:
> On Wed, Jun 20, 2012 at 8:42 AM, Emi Lu wrote:
>
> > Good morning,
> >
> > Is there a simply method in psql to format a string?
> >
> > For example, adding a space to every three consecutive letters:
> >
> > abcdefgh -> *** *** ***
> >
On Wed, Jun 20, 2012 at 8:42 AM, Emi Lu wrote:
> Good morning,
>
> Is there a simply method in psql to format a string?
>
> For example, adding a space to every three consecutive letters:
>
> abcdefgh -> *** *** ***
>
> Thanks a lot!
> Emi
>
>
I looked at "format" here:
http://www.postgresql.org
Good morning,
Is there a simply method in psql to format a string?
For example, adding a space to every three consecutive letters:
abcdefgh -> *** *** ***
Thanks a lot!
Emi
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgres