Re: Display of text fields

From: Ennio-Sr <nasr(dot)laili(at)tin(dot)it>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: nasr(dot)laili(at)tin(dot)it, pgsql-general(at)postgresql(dot)org
Subject: Re: Display of text fields
Date: 2004-09-08 19:29:19
Message-ID: 20040908192918.GA23933@deby.ei.hnet
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

* Richard Huxton <dev(at)archonet(dot)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) ]

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ed L. 2004-09-08 19:50:02 information schema table names in 8.0.0
Previous Message Arthur Hoogervorst 2004-09-08 19:25:19 Re: Returning multiple values (but one row) in plpgsql