Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I know that PostgreSQL database allows to keep track of application name for each connection and it looks like application_name variable should work with RPostgreSQL, but how exactly should I do this? Adding variable application_name = "test" to dbConnect doesn't work.

share|improve this question
    
application_name does not appear to be a parameter that you can set when connecting to a database: postgresql.org/docs/9.4/static/… – hadley Feb 18 '15 at 3:53
    
You mean in RPostgreSQL? – kismsu Feb 18 '15 at 16:46
    
No, in postgres – hadley Feb 19 '15 at 16:21
    
@hadley, 'application_name' appears in the page that you linked, it is definitely a parameter that you can set in PostgreSQL, as you can see here – ncocacola Feb 26 '15 at 16:30
    
@ncocacola ok must've missed that. You can set in dbConnect() in github.com/rstats-db/RPostgres – hadley Feb 26 '15 at 19:30

I'm not sure you can pass application_name='test' as an argument to dbConnect in RPostgreSQL (there is an optional options argument, but I couldn't figure out what kind of data it expects).

An alternative would be to run the following SQL query immediately after opening the connection:

SET application_name='test'

and it should work until you close the connection.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.