Search Postgresql Archives

Question on inserting non-ascii strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx                                      +1 888 359 3508

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux