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 20001017131753R.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
List pgsql-hackers
> > If VARSIZE returned from exprTypmod() and atttypmod passed to
> > coerce_type_typmod() is equal, the function node to call bpchar()
> > would not be added.
> 
> Um, what's wrong with that?  Seems to me that parse_coerce is doing
> exactly what it's supposed to, ie, adding only length coercions
> that are needed.

Simply clipping multibyte strings by atttypmode might produce
incorrect multibyte strings. Consider a case inserting 3 multibyte
letters (each consisting of 2 bytes) into a char(5) column.

Or this kind of consideration should be in bpcharin() as I said in the
earilier mail?
--
Tatsuo Ishii


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pgsql is 75 times faster with my new index scan
Next
From: Tom Lane
Date:
Subject: Re: length coerce for bpchar is broken since 7.0