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

From Ennio-Sr
Subject Re: Display of text fields
Date
Msg-id 20040908192918.GA23933@deby.ei.hnet
Whole thread Raw
In response to Re: Display of text fields  (Richard Huxton <dev@archonet.com>)
Responses Re: Display of text fields
List pgsql-general
* Richard Huxton <dev@archonet.com> [020904, 16:54]:
> Ennio-Sr wrote:
>
> >My questions are then:
> >
> > [cut]

> >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
>

Further to my message of 3rd inst.
Following your suggestion and after reading some documents, I created
this sql script:

-----
SELECT scheda_ltr,
    case scheda_ltr
        when 'T' then
        select * from bib_lt;
    else
        'autore, titolo, editore from bib_lt;'
    end
    FROM bib_lt;
-----
but the result is not what I was after: I get a list with either label
according to scheda_ltr being 'T' or not!
Is there any way, once the case is spotted, to obtain execution of the
query relating to that case, instead of just showing the label?
Of course I tried without the quotes obtaining parser error.


> >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? 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 ...
>

Tried substring(memo,1, 1400)    ## I think the numbers refer to bytes,
                 ## not rows (with 1,80 shows nothing)
but the uncontrolled scrolling is still there :-(
It's really sad, with all those possibilities offered by 'substr' !

Thanks for any help,
    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: Arthur Hoogervorst
Date:
Subject: Re: Returning multiple values (but one row) in plpgsql
Next
From: "Ed L."
Date:
Subject: information schema table names in 8.0.0