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.