The error messages I get from RPostgreSQL contain nonsense characters where there should be some informative text. Here are two examples:
Example 1: Querying a non-existent table
> library("RPostgreSQL")
Loading required package: DBI
> drv <- dbDriver("PostgreSQL")
> connection <- dbConnect(
+ drv,
+ dbname="postgres",
+ host=db_host,
+ port=5432,
+ user=.pguser,
+ password=.pgpass
+ )
>
> results <- dbGetQuery(connection, "SELECT * FROM t1")
Error in postgresqlExecStatement(conn, statement, ...) :
RS-DBI driver: (�W��J)
Warning message:
In postgresqlQuickSQL(conn, statement, ...) :
Could not create execute: SELECT * FROM t1 LIMIT 20
Example 2: Attempting to connect to a database with invalid credentials.
> library("RPostgreSQL")
Loading required package: DBI
> drv <- dbDriver("PostgreSQL")
> connection <- dbConnect(
+ drv,
+ dbname="postgres",
+ host=db_host,
+ port=5432,
+ user=.pguser,
+ password=.pgpass
+ )
Error in postgresqlNewConnection(drv, ...) : RS-DBI driver: (8�)
I would like to see an error message instead of RS-DBI driver: (�W��J) or RS-DBI driver: (8�). What is going on here? How can I see the complete error message?
ru_RU.KOI8-R(non-UTF-8 formatting) and intentionally made an erroneous query withPOSTgreSQL. The error message was gibberish. When I changed it toru_RU.UTF-8(a Russian and UTF-compliant alternative), my messages were no longer gibberish. Before:��������������:and after:Предупреждение:(That just means warning.)RPostgreSQL?