Incomplete error message from RPostgreSQL

149 Views Asked by At

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?

0

There are 0 best solutions below