Re: unknownin/out patch (was [HACKERS] PQescapeBytea is - Mailing list pgsql-patches

From Joe Conway
Subject Re: unknownin/out patch (was [HACKERS] PQescapeBytea is
Date
Msg-id 3CB22BDB.7030000@joeconway.com
Whole thread Raw
In response to unknownin/out patch (was [HACKERS] PQescapeBytea is not multibyte aware)  (Joe Conway <mail@joeconway.com>)
Responses Re: unknownin/out patch (was [HACKERS] PQescapeBytea is  (Tatsuo Ishii <t-ishii@sra.co.jp>)
List pgsql-patches
Tatsuo Ishii wrote:
>
>
> Try a multibyte encoding database. For example,
>
> $ createdb -E EUC_JP test
> $ psql -c 'SELECT SUBSTRING('1234567890' FROM 3)' test
>  substring
> -----------
>  3456
> (1 row)
>
> Apparently this is wrong.
> --
> Tatsuo Ishii

This problem exists in CVS tip *without* the unknownin/out patch:

# psql -U postgres testjp
Welcome to psql, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
        \h for help with SQL commands
        \? for help on internal slash commands
        \g or terminate with semicolon to execute query
        \q to quit

testjp=# SELECT SUBSTRING('1234567890' FROM 3);
  substring
-----------
  3456
(1 row)

testjp=# select * from pg_type where typname = 'unknown';
  typname | typnamespace | typowner | typlen | typprtlen | typbyval |
typtype | typisdefined | typdelim | typrelid | typelem | typinput |
typoutput | typreceive | typsend | typalign | typstorage | typnotnull |
typbasetype | typtypmod | typndims | typdefaultbin | typdefault

---------+--------------+----------+--------+-----------+----------+---------+--------------+----------+----------+---------+----------+-----------+------------+---------+----------+------------+------------+-------------+-----------+----------+---------------+------------
  unknown |           11 |        1 |     -1 |        -1 | f        | b
       | t            | ,        |        0 |       0 | textin   |
textout   | textin     | textout | i        | p          | f          |
           0 |        -1 |        0 |               |
(1 row)

This is built from source with:
#define CATALOG_VERSION_NO      200204031

./configure --enable-locale  --enable-debug --enable-cassert
--enable-multibyte --enable-syslog --enable-nls --enable-depend

Joe



pgsql-patches by date:

Previous
From: Joe Conway
Date:
Subject: Re: unknownin/out patch (was [HACKERS] PQescapeBytea is
Next
From: Tatsuo Ishii
Date:
Subject: Re: unknownin/out patch (was [HACKERS] PQescapeBytea is