Re: How to implement word wrap - Mailing list pgsql-general

From Alban Hertroys
Subject Re: How to implement word wrap
Date
Msg-id 371F6ECE-4543-4489-B903-9268C531139D@solfertje.student.utwente.nl
Whole thread Raw
In response to Re: How to implement word wrap  ("Andrus" <kobruleht2@hot.ee>)
Responses Re: How to implement word wrap  ("Andrus" <kobruleht2@hot.ee>)
List pgsql-general
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
hyphenationfor the appropriate language if you go that route. For the latter it's probably best to write it in C so you
canlink 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
thatis 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!



pgsql-general by date:

Previous
From: Ole Tange
Date:
Subject: Re: insert into test_b (select * from test_a) with different column order
Next
From: "Davor J."
Date:
Subject: Emphasizing "current item" in subclass of QAbstractItemView