Re: [GENERAL] How to implement word wrap

2010-04-03 Thread Andrus
Really, write a stored procedure that accepts (text, line_length) and returns SETOF text. You could even add hyphenation for the appropriate language if you go that route. For the latter it's probably best to write it in C so you can link hyphenation libraries to your code. Another approach that

Re: [GENERAL] How to implement word wrap

2010-03-30 Thread Alban Hertroys
On 30 Mar 2010, at 11:32, Andrus wrote: >> Just realised that's not what you're after, but my first point still stands. > > Thank you. > I tried to wrap words at 15 characters using code below. Really, write a stored procedure that accepts (text, line_length) and returns SETOF text. You could

Re: [GENERAL] How to implement word wrap

2010-03-30 Thread Andrus
Just realised that's not what you're after, but my first point still stands. Thank you. I tried to wrap words at 15 characters using code below. Issues: 1. Table rows places same word to multiple lines. How to remove them so that every word appears only in single row? 2. In last select sum(

Re: [GENERAL] How to implement word wrap

2010-03-29 Thread Thom Brown
On 29 March 2010 17:42, Thom Brown wrote: > 2010/3/29 Andrus > > Database column contains large string without line feeds. >> How to split it with word wrap between words ? >> I tried to implement word wrap using >> >> create temp table test (line char(7)); >> insert into test select repeat('aa

Re: [GENERAL] How to implement word wrap

2010-03-29 Thread Andreas Kretschmer
Andrus wrote: > Database column contains large string without line feeds. > How to split it with word wrap between words ? > I tried to implement word wrap using > > create temp table test (line char(7)); > insert into test select repeat('aa ',10); > select * from test; > > Expected result is tha

Re: [GENERAL] How to implement word wrap

2010-03-29 Thread Thom Brown
2010/3/29 Andrus > Database column contains large string without line feeds. > How to split it with word wrap between words ? > I tried to implement word wrap using > > create temp table test (line char(7)); > insert into test select repeat('aa ',10); > select * from test; > > Expected result is

[GENERAL] How to implement word wrap

2010-03-29 Thread Andrus
Database column contains large string without line feeds. How to split it with word wrap between words ? I tried to implement word wrap using create temp table test (line char(7)); insert into test select repeat('aa ',10); select * from test; Expected result is that table test contains multiple