Hi Team,
I am trying to a update query on a table in postgreSQL database from GNU R using the RpostgreSQL package. And while trying to do so I am facing an issue with the hstore data type. Below is the sample query I am passing to the database
txt <- paste("UPDATE adminvectors.county SET attributes= attributes || hstore('usco@TP-TotPop@2010',",new_data$TP.TotPop[new_data$FIPS == i],") where geoid=",i)
dbGetQuery(con, txt)
In the above query I am passing the value of a variable in a data frame as value for hstore key.
And I am getting the following error
In addition: Warning message:
In postgresqlQuickSQL(conn, statement, ...) :
Could not create executeUPDATE adminvectors.county SET attributes= attributes || hstore('usco@TP-TotPop@2010', 9.315 ) where geoid= 21055
Error in postgresqlExecStatement(conn, statement, ...) :
RS-DBI driver: (could not Retrieve the result : ERROR: function hstore(unknown, numeric) does not exist
LINE 1: ...adminvectors.county SET attributes= attributes || hstore('us...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
Is there a way to resolve this driver issue?
Any lead for this issue is appreciated.
Thanks and Regards,
Ravi Varma Alluru.