Re: Selecting a constant question

Поиск
Список
Период
Сортировка
Искать
От
Alvaro Herrera
Тема
Re: Selecting a constant question
Дата
Msg-id
20070611221604.GB24760@alvh.no-ip.org
Ответ на
Список
Дерево обсуждения
Re: Selecting a constant question "Larry McGhaw" <lmcghaw@connx.com>
Re: Selecting a constant question Andrew Dunstan <andrew@dunslane.net>
Re: Selecting a constant question "Larry McGhaw" <lmcghaw@connx.com>
Re: Selecting a constant question Martijn van Oosterhout <kleptog@svana.org>
Re: Selecting a constant question "Larry McGhaw" <lmcghaw@connx.com>
Re: Selecting a constant question Hannu Krosing <hannu@skype.net>
Re: Selecting a constant question "Joshua D. Drake" <jd@commandprompt.com>
Re: Selecting a constant question "Dann Corbit" <DCorbit@connx.com>
Re: Selecting a constant question Brian Hurt <bhurt@janestcapital.com>
Re: Selecting a constant question "Larry McGhaw" <lmcghaw@connx.com>
Re: Selecting a constant question Andrew Dunstan <andrew@dunslane.net>
Re: Selecting a constant question "Larry McGhaw" <lmcghaw@connx.com>
Re: Selecting a constant question Gregory Stark <stark@enterprisedb.com>
Dann Corbit wrote:

> > "Dann Corbit"  writes:
> > 
> > In fact psql needs it and implements this. It has to skim through the
> > entire
> > result set to calculate the column widths. It's quite a lot of work
> but
> > the
> > server is in no better position to do it than psql.
> 
> Reading the data twice sounds a little painful.  What if there are 30
> million rows?

You get an "out of memory" error.

> > On the contrary the server is missing quite a bit of information of
> > how you intend to display the information. Do you need the number of
> > bytes or characters? Are all the characters the same width in your
> > display system?  What about currency symbols? Do you intend to
> > reverse any quoting or just display backslashes?
> 
> Giving me the information about the data type will be enough.  As an
> example, in this case we have varchar data.  If the server should be so
> kind as to report varchar(1) for '1' or varchar(3) for '123' then I
> would not have any difficulty binding the data to a grid.

Oh, you have the length information for each datum all right.  It's on
the first four bytes of it.

-- 
Alvaro Herrera                               http://www.PlanetPostgreSQL.org/
"The West won the world not by the superiority of its ideas or values
or religion but rather by its superiority in applying organized violence.
Westerners often forget this fact, non-Westerners never do."
(Samuel P. Huntington)

В списке pgsql-hackers по дате отправления
От: Dann Corbit
Дата:
От: Dann Corbit
Дата:
FAQ