Re: length coerce for bpchar is broken since 7.0

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: length coerce for bpchar is broken since 7.0
Date: 2000-10-17 13:33:48
Message-ID: 20001017223348M.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> It's just hardwired knowledge about that particular datatype. In the
> light of your comments, it seems clear that the code here is wrong
> for the MULTIBYTE case: instead of plain VARSIZE(), it should be
> returning the number of multibyte characters + 4 (or whatever
> atttypmod is defined to mean for MULTIBYTE bpchar). I think I wrote
> this code to start with, so you can blame me for the fact that it
> neglects the MULTIBYTE case :-(

I'm going to fix the problem by changing bpcharin() rather than
changing exprTypmod(). Surely we could fix the problem by changing
exprTypmod() for INSERT, however, we could not fix the similar problem
for COPY FROM in the same way. Changing bpcharin() would solve
problems of both INSERT and COPY FROM. So bpcharin() seems more
appropreate place to fix both problems.
--
Tatsuo Ishii

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2000-10-17 13:34:18 incompatible changes of PQsetdbLogin()
Previous Message Devik 2000-10-17 13:23:55 Re: pgsql is 75 times faster with my new index scan