這是一個新的,我還沒有在其他stackoverflow網站上發現任何提及。RPostgreSQL訪問數據庫,錯誤:無法找到函數「show」的繼承方法,用於簽名「PostgreSQLConnection」
所以我在R編程,並使用RPostgreSQL包訪問Postgres 9.1.5數據庫。所以我創建了與數據庫的連接,正如我通常所做的那樣,現在我收到了一個奇怪的錯誤。
db.conn = function(){
## This function creates a connection to the database. Subsequent
## functions that access the db will go through this function.
drv = dbDriver("PostgreSQL")
con = dbConnect(drv, user = "user", password = "password", dbname = "dbname", host = "localhost", port = 5432)
return(con)
}
所以當我創建一個對象:
testdb = db.conn()
的對象似乎生成,但是當我鍵入
testdb
Error in function (classes, fdef, mtable) :
unable to find an inherited method for function "show", for signature "PostgreSQLConnection"
我從來沒有見過這個錯誤。有關它可能來自哪裏的任何建議?任何幫助,將不勝感激。
謝謝你的幫助德克。嗯,我仍然得到錯誤,但它似乎像連接對象工作正常。我想知道它是否可能與我的Postgresql版本有關?但無論如何,現在看來這不是問題。再次感謝。 – krishnab
我遇到同樣的問題,並且添加您提到的參數對我沒有任何幫助。 con < - dbConnect(dbDriver('PostgreSQL'),db ='....',user ='SYSTEM',password ='....',host ='localhost',port ='5432') 我仍然收到上述@krishnab所述的錯誤。連接工作正常,直到我開始創建用戶來正確處理來自Jenkins的連接。 – JAponte
好的......出於某種原因,我清理了我的工作區,重新定義了con,現在它打印得很好。 – JAponte