1

I have build up a postgresql 9.2 database. My table looks like that:

CREATE DATABASE "EURUSD_M1"
  WITH OWNER = fadmin
       ENCODING = 'UTF8'
       TABLESPACE = pg_default
       LC_COLLATE = 'German_Germany.1252'
       LC_CTYPE = 'German_Germany.1252'
       CONNECTION LIMIT = -1;

However when trying to connect thorugh the rpostgresql driver I get:

> drv <- dbDriver("PostgreSQL")   ## loads the PostgreSQL driver
> con <- dbConnect(drv, port='5432', dbname='EURUSD_M1',
+       user='fadmin')   ## Open a connection 
Error in postgresqlNewConnection(drv, ...) : 
  RS-DBI driver: (could not connect fadmin@local on dbname "EURUSD_M1"
)

btw to specify host = 'localhost' does not change anything! Also fadmin is a superuser in my db!

Here are further connection information:

enter image description here

Any ideas what I am doing wrong?

I appreciate your answers!

user2051347
  • 1,609
  • 4
  • 23
  • 34

1 Answers1

0

RPostgreSQL, just like the psql command-line tool, connect via tcp/ip network interface even when you have the server on the same machine.

For this to work, you must enable network access; see the various PostreSQL HOWTOs and guides. You probably have to edit / alter a file call pg_hba.conf or similar.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
  • Thx for your answer! The previous screenshot was basically my `pg_hba.conf` file. As you can see in the newly added screenshot(just made it larger), my database is on localhost and therefore network access enabled. btw the thing also is, that the thrown exception always stays the same and does not give further information what `exactly` is wrong, any suggestion how to edit that? – user2051347 Jan 18 '14 at 08:16
  • On Linux, I switched from 'md5' (last column) to ident and run an indentd daemon -- not sure if that works. But I still suspect that is an issue in you running the server on Windows, rather than in RPostgreSQL. – Dirk Eddelbuettel Jan 18 '14 at 14:07
  • add the line `local all all md5` to your `pg_hba.conf` file. – Alex Nov 18 '14 at 09:06