Skip site navigation (1) Skip section navigation (2)

Re: BUG #3413: character string or multibyte character to "char"

From: Toru SHIMOGAKI <shimogaki(dot)toru(at)oss(dot)ntt(dot)co(dot)jp>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3413: character string or multibyte character to "char"
Date: 2007-06-26 11:09:02
Message-ID: 4680F3CE.7090702@oss.ntt.co.jp (view raw or flat)
Thread:
Lists: pgsql-bugs
This is a sample patch for charin() and charrecv(). I'm not sure for charout();
it can return non-ASCII character...


Toru SHIMOGAKI wrote:
> The following bug has been logged online:
> 
> Bug reference:      3413
> Logged by:          Toru SHIMOGAKI
> Email address:      shimogaki(dot)toru(at)oss(dot)ntt(dot)co(dot)jp
> PostgreSQL version: 8.2.4
> Operating system:   Red Hat Enterprise Linux AS4
> Description:        character string or multibyte character to "char"
> Details: 
> 
> When a character string or a multibyte character is inserted to "char"
> column, no error occurs. Is this a bug? Should it be checked as "not single
> character" in charin(), charrecv() and charout()? 
> 
> Anyway, I can't find any spec descriptions in the following document;
>   http://www.postgresql.org/docs/8.2/static/datatype-character.html
> 
> Best regards,
> 
> 
> ----
> 
> postgres=# select version();
>                                               version
> ----------------------------------------------------------------------------
> -----------------------
>  PostgreSQL 8.2.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.6
> 20060404 (Red Hat 3.4.6-3)
> (1 row)
> 
> postgres=# create table test(flag "char");
> CREATE TABLE
> postgres=# \d test
>      Table "public.test"
>  Column |  Type  | Modifiers
> --------+--------+-----------
>  flag   | "char" |
> 
> postgres=# insert into test values('a');
> INSERT 0 1
> postgres=# insert into test values('bb');
> INSERT 0 1
> postgres=# insert into test values('eeeee');
> INSERT 0 1
> postgres=# insert into test values('あ');
> INSERT 0 1
> postgres=# select * from test;
>  flag
> ------
>  a
>  b
>  e
> 
> (4 rows)
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 7: You can help support the PostgreSQL project by donating at
> 
>                 http://www.postgresql.org/about/donate
> 
> 

-- 
Toru SHIMOGAKI<shimogaki(dot)toru(at)oss(dot)ntt(dot)co(dot)jp>
NTT Open Source Software Center

Attachment: char_length_check.patch
Description: text/plain (717 bytes)

In response to

pgsql-bugs by date

Next:From: Zdenek KotalaDate: 2007-06-26 12:29:40
Subject: Re: REVOKE CREATE does not work on default tablespace
Previous:From: Toru SHIMOGAKIDate: 2007-06-26 10:59:11
Subject: BUG #3413: character string or multibyte character to "char"

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group