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