From: | mike g <mike(at)thegodshalls(dot)com> |
---|---|
To: | Vinay Jain <vinayjain(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Formatting Function.. |
Date: | 2004-07-05 05:49:43 |
Message-ID: | 1089006583.12564.34.camel@localhost.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Then again varchar might not keep the padded blanks by default. Perhaps
casting to a char data type would be better.
On Mon, 2004-07-05 at 00:44, mike g wrote:
> Perhaps,
>
> select cast(name as varchar(desired length)) as name, age from student;
>
> Mike
> On Mon, 2004-07-05 at 00:19, Vinay Jain wrote:
> > Hi..
> > I am newbe in postgresql so please help me though the question may be
> > very easy to answer..
> > Is there any formatting function to get output with fix lengths..for
> > example my query is..
> > schema is:
> >
> > Student
> > (name Varchar,
> > age integer);
> >
> > select name, age from student;
> > the output is like this..
> > Name | Age
> > xyz | 22
> >
> > I want this length of name to be of my choice...is it possible..& how..
> >
> > thanks in advance
> > Regards
> > Vinay
> >
From | Date | Subject | |
---|---|---|---|
Next Message | Andrew Bartley | 2004-07-05 06:17:53 | Re: Formatting Function.. |
Previous Message | mike g | 2004-07-05 05:44:10 | Re: Formatting Function.. |