Re: [GENERAL] view columm size.....

From: "Ross J(dot) Reedstrom" <reedstrm(at)wallace(dot)ece(dot)rice(dot)edu>
To: Arnaud FLORENT <aflorent(at)iris-tech(dot)fr>
Cc: PostgreSQL general ML <pgsql-general(at)hub(dot)org>
Subject: Re: [GENERAL] view columm size.....
Date: 2000-02-10 17:35:10
Message-ID: 20000210113510.A8742@rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Feb 10, 2000 at 05:17:18PM +0100, Arnaud FLORENT wrote:
> "Ross J. Reedstrom" a écrit :
>
> > On Thu, Feb 10, 2000 at 10:31:18AM +0100, Arnaud FLORENT wrote:
> > > hi,
> > >
> > Hmm, try something like:
> >
> > substr("ColView",1,12)
> >
> > That should give you the first 12 characters, i.e. all of them. See if
> > the UPDATE likes it.
>
> this works but i would like to understant this behaviour......
>
> i've got the same problem with a select into
> MAX( <char(12) column>) becomes a char (8190)!!!!!!!!!!!!
>

This depends on the field definitions you're using. The SQL standard
says that CHAR(X) values will be padded with whitespace to the full
column width. Sometimes, when moving data around, one needs to be
careful where it's going to be expanded, and were not. Usually, I don't
need the whitespace at all, so I can fix things with btrim() (removes
whitespace from both ends)

Ross
--
Ross J. Reedstrom, Ph.D., <reedstrm(at)rice(dot)edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St., Houston, TX 77005

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ed Loehr 2000-02-10 18:24:46 Re: [GENERAL] Vacuum goes into spin
Previous Message Martin Kresse 2000-02-10 17:21:34 How to quietly increment a SEQUENCE