Re: Simple method to format a string?

From: Ben Chobot <bench(at)silentmedia(dot)com>
To: emilu(at)encs(dot)concordia(dot)ca
Cc: "pgsql-general(at)postgresql(dot)org >> \"pgsql-general(at)postgresql(dot)org\"" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Simple method to format a string?
Date: 2012-06-20 17:43:25
Message-ID: A9E5D1E6-EF82-4F80-A469-3900D4C17807@silentmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Jun 20, 2012, at 7:43 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'm unaware of such a function (it seems like a generic format() function's arguments would be so complex as to be almost unusable) but you can make use of locales to do some formatting for you. See http://www.postgresql.org/docs/9.1/static/locale.html.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Norberto Dellê 2012-06-20 17:45:16 How to determine to which version of PostgreSQL a patch was applied
Previous Message Thomas Kellerer 2012-06-20 17:43:12 Re: efficiency of wildcards at both ends