[R-sig-DB] dbWriteTable of RPostgreSQL can't insert data into PostgreSQL Server.

Tomoaki NISHIYAMA tomo@k|n @end|ng |rom kenroku@k@n@z@w@-u@@c@jp
Sun Feb 6 02:41:48 CET 2011


Hi,

Xiaobo Gu wrote:

| 1. If there are text data with Chinese character, then data will not
| be inserted into database server even there is only one column of the
| dataframe.
| 2. I can send you the sample data which can't be inserted.

This could perhaps happen if the character encoding is not appropriately 
set.
Refer to http://www.postgresql.org/docs/8.4/interactive/multibyte.html
for the Postgresql side.

For proper operation, the client encoding should match the encoding of 
the file produced by write.table.
As this write.table encoding cannot be changed right now,
you check the write.table encoding and set client encoding.

According to
http://cran.r-project.org/doc/manuals/R-data.pdf
"as from R 2.13.0 write.table has a fileEncoding argument"
So, after that, we may be able to set the encoding properly relatively 
easily (automatically),
but not with 2.12.X.

No special care is taken for the encoding in RPostgreSQL and
we currently don't have tests for non-ascii text.
We might be able to make some test for UTF-8, but supporting every
possible encoding does not seem doable.
-- 
Tomoaki




More information about the R-sig-DB mailing list