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

Поиск
Список
Период
Сортировка
От Ross J. Reedstrom
Тема Re: [GENERAL] view columm size.....
Дата
Msg-id 20000210113510.A8742@rice.edu
обсуждение исходный текст
Ответ на Re: [GENERAL] view columm size.....  (Arnaud FLORENT <aflorent@iris-tech.fr>)
Список 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@rice.edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005

В списке pgsql-general по дате отправления:

Предыдущее
От: "Martin Kresse"
Дата:
Сообщение: How to quietly increment a SEQUENCE
Следующее
От: Ed Loehr
Дата:
Сообщение: Re: [GENERAL] Vacuum goes into spin