Re: length coerce for bpchar is broken since 7.0 - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: length coerce for bpchar is broken since 7.0
Date
Msg-id 20001017223348M.t-ishii@sra.co.jp
Whole thread Raw
In response to Re: length coerce for bpchar is broken since 7.0  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: length coerce for bpchar is broken since 7.0  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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


pgsql-hackers by date:

Previous
From: Devik
Date:
Subject: Re: pgsql is 75 times faster with my new index scan
Next
From: Tatsuo Ishii
Date:
Subject: incompatible changes of PQsetdbLogin()