Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7010053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:56:29+00:00 2026-05-27T21:56:29+00:00

I am newbie trying to understand how R and PostgreSQL can talk to each

  • 0

I am newbie trying to understand how R and PostgreSQL can talk to each other. I have used R lately only for data analysis but now, I am trying to import directly from a database. I have installed RPostgreSQL and have connected to my database, I can see all the tables but I cannot edit them. I would like get some data out of them but when I run the

the following code:

>query<-"SELECT * FROM Events"
> rs <- dbSendQuery(con,query)
Error in postgresqlExecStatement(conn, statement, ...) : 
  RS-DBI driver: (could not Retrieve the result : ERROR:  relation "events" does not exist
LINE 1: SELECT * FROM Events

My other table names are not great either.
“Alarm_Reports” ,”Configuration”,”Event_Details”,”Events”

Is there something basic about addressing the tables that I am missing?

Thanks for all the help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:56:30+00:00Added an answer on May 27, 2026 at 9:56 pm

    As I mentioned in my comment, quotes may be needed. Here is actual code from one of our unit tests files:

    res <- dbGetQuery(con, "create table Foo1 (f1 int)")
    res <- dbGetQuery(con, "create table \"Foo2\" (f1 int)")
    
    cat("Test should create foo1 and Foo2 tables\n")
    ## res <- dbGetQuery(con, paste("SELECT * FROM information_schema.tables",
    ##                              "WHERE table_schema = 'public'")
    ## print res
    
    if (dbExistsTable(con, "Foo1")) {
        cat("FAIL - Foo1 Table exists.\n")
    }
    else {
        cat("Pass - Foo1 Table does not exist.\n")
    }
    
    if (dbExistsTable(con, "foo1")) {
        cat("Pass - foo1 Table exists.\n")
    }
    else {
        cat("FAIL - foo1 Table does not exist.\n")
    }
    
    if (dbExistsTable(con, "Foo2")) {
        cat("Pass - Foo2 Table exists.\n")
    }
    else {
        cat("FAIL - Foo2 Table does not exist.\n")
    }
    
    if (dbExistsTable(con, "foo2")) {
        cat("FAIL - foo2 Table exists.\n")
    }
    else {
        cat("Pass - foo2 Table does not exist.\n")
    }
    
    if (dbExistsTable(con, "\"Foo2\"")) {
        cat("FAIL - \"Foo2\" Table exists.\n")
    }
    else {
        cat("Pass - \"Foo2\" Table does not exist.\n")
    }
    
    if (dbExistsTable(con, "\"foo2\"")) {
        cat("FAIL - \"foo2\" Table exists.\n")
    }
    else {
        cat("Pass - \"foo2\" Table does not exist.\n")
    }
    
    res <- dbGetQuery(con, "drop table Foo1")
    res <- dbGetQuery(con, "drop table \"Foo2\"")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Newbie Warning I have a simple but vexing problem trying to disable an NSButton.
I am an absolute newbie in Haskell yet trying to understand how it works.
I am completely a newbie in continuous integration but I am trying to learn
Total newbie question but this is driving me mad! I'm trying this: myInt =
I am a newbie to wxpython . I am trying to have a Frame
I am a newbie in Spring and am trying to understand the below concept.
DISCLAIMER : I am still a Rails/Cucumber newbie but I am trying to learn.
I am a newbie and trying to understand concepts of inheritance and design patterns.
Hibernate newbie here. I am trying my best to understand Hibernate and ORM in
I`m a newbie at JavaScript trying to understand this tutorial about currying from Oreilly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.