Re: Selecting a constant question

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Selecting a constant question
Дата
Msg-id 87ejkinp9e.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: Selecting a constant question  ("Dann Corbit" <DCorbit@connx.com>)
Ответы Re: Selecting a constant question  ("Dann Corbit" <DCorbit@connx.com>)
Список pgsql-hackers
"Dann Corbit" <DCorbit@connx.com> writes:

> Surely, we cannot be the only people who will need this information.  If
> (for example) someone wants to bind to a grid, then the maximum size has
> to be known in advance.

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.

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?

Even knowing how many characters and assuming fixed character widths that
wouldn't even be enough to set your grid control widths. Usually people like
numeric quantities decimal aligned and so two records "1.00" and "0.01" will
take much more width than two records with "1.00" and "2.00".

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com



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

Предыдущее
От: "Dann Corbit"
Дата:
Сообщение: Re: Selecting a constant question
Следующее
От: "Dann Corbit"
Дата:
Сообщение: Re: Selecting a constant question