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 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 may be viable is to use windowing functions, but I'm not 
so sure it's possible to have a window that is being defined by the data it's 
running over (eg. a window defined by the length of an accumulated line of 
text).

Alban Hertroys

--
Screwing up is an excellent way to attach something to the ceiling.


!DSPAM:737,4bb1d23410411798520618!



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to