Re: Limiting character count - Mailing list pgsql-novice

From Christoph Frick
Subject Re: Limiting character count
Date
Msg-id 20060726090938.GM25722@byleth.sc-networks.de
Whole thread Raw
In response to Limiting character count  ("roy simkes" <roysimkes@hotmail.com>)
List pgsql-novice
On Wed, Jul 26, 2006 at 08:47:10AM +0000, roy simkes wrote:

> Hi,I'm have a field which allows maximum 1000 characters. But when I
> fecth it I only want to show first 50 characters and then give a link
> to see the whole data. Is there a way to do this easily with
> postgresql or I should do this using php functions and other logic
> things.I hope I was clear enough I should show something like this:Hi,
> I'm new in town and I'm a little bit lost can yo... (more)Where the
> whole text is :Hi I'm new in town and I'm a little bit lost can you
> show me where is Mr Brown's house?

this depends on what your applications is doing here. if you have a
large list (with the 50 char preview) then your "full view" will likely
be a seperate call (e.g. javascript window, iframe, ...); then you can
use the substring/string manipulation methods of postgres to only get
the data you need. and in the next call get only the full-data that are
requested by the user. but if you are only showing one row and want to
"hide" the full extend there, then you are better of by do you hiding it
in the app.

--
cu

Attachment

pgsql-novice by date:

Previous
From: kmh496
Date:
Subject: Re: case-insensitive Index
Next
From: Richard Broersma Jr
Date:
Subject: Fwd: Re: Installation "baby" steps (next steps)?