Re: Selecting a constant question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Selecting a constant question
Дата
Msg-id 27842.1181608341@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Selecting a constant question  ("Larry McGhaw" <lmcghaw@connx.com>)
Ответы Re: Selecting a constant question  ("Dann Corbit" <DCorbit@connx.com>)
Список pgsql-hackers
"Larry McGhaw" <lmcghaw@connx.com> writes:
> I think perhaps we have lost sight of the main issue:
> 1) libpq can properly describe the maximum internal data size of any
> numeric or char column in a table via Pqfsize
> 2) libpq can properly describe the maximum internal data size of any
> varchar column via Pqfmod
> 3) libpq can properly describe the maximum internal data size of any
> numeric constant in a SQL statement via Pqfsize

None of the above statements are actually true, at least not when you
take off your blinders and note the existence of unconstrained-width
numeric and text columns.

> The database *knows* this size of the char constant (obviously),

No, what it knows (and reports) is type information.  There are a small
number of datatypes where you can infer a maximum width from knowledge
of the datatype.  There are many others where you can't set an upper
bound from this knowledge --- at least not a usefully tight one.

Anyway, if we were to cast those constants to something other than
unknown, it would be text, not varchar, and you'd still have the same
issue.
        regards, tom lane


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

Предыдущее
От: "Dann Corbit"
Дата:
Сообщение: Re: Selecting a constant question
Следующее
От: "Dann Corbit"
Дата:
Сообщение: Re: Got no response last time on setsockopt post, so I thought I would reiterate.