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

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Dave Blasby <dblasby(at)refractions(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: BUG: text(varchar) truncates at 31 bytes
Date: 2001-10-03 18:59:34
Message-ID: Pine.BSF.4.21.0110031152490.51842-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.
:)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martín Marqués 2001-10-03 19:43:26 Re: Missing inserts
Previous Message Bruce Momjian 2001-10-03 18:56:02 Re: BUG: text(varchar) truncates at 31 bytes