Re: [SQL] Is there a similarity-function that minds national charsets?

2012-06-20 Thread Craig Ringer
On 06/21/2012 12:30 AM, Andreas wrote: Hi, Is there a similarity-function that minds national charsets? Over here we've got some special cases that screw up the results on similarity(). Our characters: ä, ö, ü, ß could as well be written as: ae, oe, ue, ss e.g. select similarity ( 'Müller

Re: [SQL] Simple method to format a string

2012-06-20 Thread Emi Lu
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

Re: [SQL] Simple method to format a string

2012-06-20 Thread k...@rice.edu
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 -> *** *** *** > >

Re: [SQL] Simple method to format a string

2012-06-20 Thread Wes James
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

[SQL] Is there a similarity-function that minds national charsets?

2012-06-20 Thread Andreas
Hi, Is there a similarity-function that minds national charsets? Over here we've got some special cases that screw up the results on similarity(). Our characters: ä, ö, ü, ß could as well be written as: ae, oe, ue, ss e.g. select similarity ( 'Müller', 'Mueller' ) results to: 0.363636 In

[SQL] Simple method to format a string

2012-06-20 Thread Emi Lu
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