Re: Converting char to varchar automatically

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
Cc: Melvin Davidson <melvin6925(at)gmail(dot)com>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Harald Fuchs <hari(dot)fuchs(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Converting char to varchar automatically
Date: 2014-10-07 18:02:51
Message-ID: 28075.1412704971@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sergey Konoplev <gray(dot)ru(at)gmail(dot)com> writes:
> On Tue, Oct 7, 2014 at 10:16 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Sergey Konoplev <gray(dot)ru(at)gmail(dot)com> writes:
>>> BTW, where can I find a list of type1->type2 pairs that doesn't
>>> require full table lock for conversion?

>> There aren't any. Sometimes you can skip a table rewrite, but that
>> doesn't mean that a lesser lock is possible.

> Oh, sorry, it was a typo, I meant "that doesn't require a full table rewrite".

Roughly speaking it's the pairs that have a binary (WITHOUT FUNCTION)
coercion according to pg_cast, although we have special logic for a few
cases such as varchar(M) -> varchar(N).

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message israel 2014-10-07 19:06:07 Re: Processor usage/tuning question
Previous Message Sergey Konoplev 2014-10-07 17:19:15 Re: Converting char to varchar automatically