Re: Display of text fields - Mailing list pgsql-general

From Ennio-Sr
Subject Re: Display of text fields
Date
Msg-id 20040902221235.GA13383@deby.ei.hnet
Whole thread Raw
In response to Re: Display of text fields  (Richard Huxton <dev@archonet.com>)
List pgsql-general
* Richard Huxton <dev@archonet.com> [020904, 16:54]:
> Ennio-Sr wrote:
>
> >My questions are then:
> [ ... ]
> >2. In case I put the memos in the main table, would it be possible to
> >   control someway the display of memo-text fields? [Only some of the
> >   records have a memo, and a referring col set to 'T', so I'm looking
> >   for a selective instruction, such as: if ctl_memo='T' display memo,
> >   else, display the other cols only].
>
> Use a view along with a CASE...END expression
>

> >3. Does the pager work better on version 7.4.3?
>
> I'm not aware of any changes. Is the problem when you have a single
> text-field that takes up too much space?

Not necessarily. I'm testing with a table containing a dozen text
fields, each one large from 6 to 20 lines; so, when I run a select with
no 'limit n', (I suppose) the pager doesn't know how to split the text
field in order to accomodate it to the max no. of lines the screen can
show.
e.g., if rec. no 1 has a text of 15 lines and rec. 2 has 20 lines, the
pager should be able to split rec. no. 2 into two parts (9 lines to the
first - so that it can show together with rec. no. 1 (15+9=24) - and 11
to the second.

> If so, I'd construct my view
> with a substring:
>
> CREATE VIEW my_view AS
> SELECT a,b,c,substring(long_memo_field, 1, 80)
> FROM ...
>

Thank you so much, Richard! I'll search the documentation for the
solutions you suggest which I'm not yet acquainted with ...
    Ennio

--
[Perche' usare Win$ozz (dico io) se ..."anche uno sciocco sa farlo.     \\?//
 Fa' qualche cosa di cui non sei capace!"   (diceva Henry Miller) ]     (°|°)
[Why to use Win$ozz (I say) if ... "even a fool can do that.             )=(
 Do something you aren't good at!" (used to say Henry Miller) ]

pgsql-general by date:

Previous
From: Gaetano Mendola
Date:
Subject: Re: Can we return a table from a function?
Next
From: Clodoaldo Pinto Neto
Date:
Subject: Re: pg_restore: error returned by PQputline