Re: Libpq: PQftype, PQfsize

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Libpq: PQftype, PQfsize
Дата
Msg-id 3103.1281462046@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Libpq: PQftype, PQfsize  ("Bozena Potempa" <Bozena.Potempa@otc.pl>)
Ответы Re: Libpq: PQftype, PQfsize  ("Bozena Potempa" <Bozena.Potempa@otc.pl>)
Список pgsql-hackers
"Bozena Potempa" <Bozena.Potempa@otc.pl> writes:
> I have a test table with varchar(40) column. After executing the following
> query: 
> select substr(fc,1,2) from test
> PQftype returns for the result column PG_TYPE_TEXT and PQfsize returns -1. 
> Is it the expected behaviour?

Yes.  substr() returns text.  But even if it returned varchar, you'd
probably get -1 for the fsize.  PG does not make any attempt to predict
the result width of functions.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: 8.3 to 8.4 Upgrade issues