Question on inserting non-ascii strings

Поиск
Список
Период
Сортировка
От Steven Lembark
Тема Question on inserting non-ascii strings
Дата
Msg-id 20090514112533.16baf3e8@bird.wrkhors.com
обсуждение исходный текст
Ответы Re: Question on inserting non-ascii strings  (Sam Mason <sam@samason.me.uk>)
Список pgsql-general
Using Postgres 8.3 with DBI 1.607, DBD::Pg 2.12.0, perl v5.10.0,

I am trying to insert the medline database
contents, which include non-ascii char's,
hopefully using a prepared query.

Playing with the locale, encoding,
client_encoding, standard_conforming_strings,
leaves me able to insert values using one-off
querys, but I need to find out the correct way
to handle these using prepared querys (currently
using C, SQL_ASCII, SQL_ASCII, off).

For example, given:

    create table foo ( bar varchar(255) );

and the author's name

    "P\x8FAZEK"

Setting the client_encoding to "SQL_ASCII"
does not help: the values can be inserted
via

    E'P\x8FAZEK'

but E'$1' will simply insert the "$1" literal
into the table.

Using

    convert_from( $1, 'SQL_ASCII' ) gets

gets the values input, but with a warning.

Q: Is there any combination of locale, encoding,
   client_encoding or functions that will allow
   me to insert values with these escape sequences
   without getting the warnings?

Trying this in psql with various combinations of
prepares statements leaves me unable to use
convert_from with a varchar argument (requires
bytea).

If there is an example in the doc's I'd appreciate
a link to it.

thanks

--
Steven Lembark                                            85-09 90th St.
Workhorse Computing                                 Woodhaven, NY, 11421
lembark@wrkhors.com                                      +1 888 359 3508

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Failure during initdb - creating dictionaries ... FATAL: could not access file "$libdir/libdict_snowball": No such file or directory
Следующее
От: "George Kao"
Дата:
Сообщение: Re: how to extract data from bytea so it is be used in blob for mysql database