Re: BUG: text(varchar) truncates at 31 bytes

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: BUG: text(varchar) truncates at 31 bytes
Дата
Msg-id Pine.BSF.4.21.0110031152490.51842-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на BUG: text(varchar) truncates at 31 bytes  (Dave Blasby <dblasby@refractions.net>)
Ответы Re: BUG: text(varchar) truncates at 31 bytes  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> #select text(v) from t;
> 
>              text               
> ---------------------------------
>  0123456789a0123456789b012345678
> (1 row)
> 
> Truncation occurs.

Looking at the explain verbose output, it looks
like it may be doing a conversion to name because
it looks like there isn't a text(varchar), but
there's a text(name) and a name(varchar).  My 
guess is there's no text(varchar) because they're
considered binary compatible.

> Work around:
> 
> # select v::text from t;
>                    ?column?                   
> ----------------------------------------------
>  0123456789a0123456789b0123456789c0123456789d
> (1 row)

These types are probably marked as binary compatible, so
nothing major has to happen in the type conversion.  Same
thing happens in CAST(v AS text).

> Is there anyway to determine what postgresql is doing in its automagic
> function calls? I guess I'm asking for an EXPLAIN that describes
> function calls.  For example, 
> EXPLAIN select text(v) from t;
You can use EXPLAIN VERBOSE if you're willing to wade through the output.
:)




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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: BUG: text(varchar) truncates at 31 bytes
Следующее
От: Martín Marqués
Дата:
Сообщение: Re: Missing inserts