[R-sig-DB] Error in postgresqlExecStatement...RS-DBI driver: (could not Retrieve the result...)

Neil Tiffin ne||t @end|ng |rom ne||t||||n@com
Wed Feb 9 21:51:57 CET 2011


On Feb 8, 2011, at 9:55 PM, Rex Hu wrote:

> Hi all!
> 
> I am a total newb in database programming, but unfortunately, I am working on a project that requires database programming using R. I hope that some one could help me about this. Thank you all in advance!
> 
> I ran into this error when I was trying to run an R program written by someone else. It occurs when executing this 'big loop' (the R code of this loop is in the attachment). I have absolutely no clue what is going on.
> 
> The environment where I ran the program is Red Hat Enterprise Linux 6, and PostgreSQL 8.4.7. R version is  2.12.1.
> 
> The following are error messages.
> 
> 64490 :class(mydata):  data.frame
>   cleaning.out.cols: geofencename, geofencereason
>   prod(u.gfn == ""): 0
>   prod(u.gfr == ""): 0
>   dim(mydata): 185 7
>   Creating hourflag, odoflag, stateflag...done.
>   Appending them to the data.frame...done.
>   Sum:: hourflag: 10 , odoflag: 10 , stateflag: 12 , hrOdoflag: 10
>   Starting hrodoflag.index loop...
>   hrodoflag.index loop finished.

This looks like the program made it to this point as this is the only line of code that contains "loop finished":

  if (debugindex > 1) cat("\throdoflag.index loop finished.\n")

  ######################################################
  ######################################################
  ######################################################

  message("Delete 'public.tmptable'")

However, there is no reason why the message "Delete 'public.tmptable'" is not in your output.  There is no code to execute between these two points.  Are you sure this is the code that is causing the problem?

> Error in postgresqlExecStatement(conn, statement, ...) :
> RS-DBI driver: (could not Retrieve the result : ERROR:  relation "public.tmptable" already exists

At first glance it appears that "public.tmptable" already exists.  Remove this table from your database and try again.

> )
> In addition: Warning messages:
> 1: In dir.create(datadumpdir, showWarnings = TRUE, recursive = TRUE,  :
> '/scratch/kan/datadump' already exists
> 2: In dir.create(misclwritedir, showWarnings = TRUE, recursive = TRUE,  :
> '/scratch/kan/work/bordercrossing/miscl/AU08_100301' already exists
> 3: In dir.create(datawritedir, showWarnings = TRUE, recursive = TRUE,  :
> '/scratch/kan/work/bordercrossing/data/cevaAU08_100301' already exists
> Error in postgresqlExecStatement(conn, statement, ...) :
> RS-DBI driver: (could not Retrieve the result : ERROR:  relation "public.tmptable" does not exist
> )
> In addition: Warning message:
> In postgresqlQuickSQL(conn, statement, ...) :
> Could not create executeCREATE TABLE "public.tmptable"
> ( "id_tb100301trp" bigint,
>   "bridge_new" text,
>   "tripscore" float8,
>   "stflag" float8,
>   "hrflag" float8,
>   "odflag" float8
> )
> Error in postgresqlExecStatement(conn, statement, ...) :
> RS-DBI driver: (could not Retrieve the result : ERROR:  relation "public.tmptable" does not exist
> )
> In addition: Warning message:
> In postgresqlQuickSQL(conn, statement, ...) :
> Could not create executeCOPY public.tmptable FROM '/tmp/rpsql.G19577' WITH CSV HEADER QUOTE AS '"'
> Error in postgresqlExecStatement(conn, statement, ...) :
> RS-DBI driver: (could not Retrieve the result : ERROR:  relation "public.tmptable" does not exist
> )
> In addition: Warning message:
> In postgresqlQuickSQL(conn, statement, ...) :
> Could not create executeUPDATE  au08_100301.tb100301trp  SET  bridge_new  =  public.tmptable.bridge_new FROM  public.tmptable
> WHERE  au08_100301.tb100301trp.id_tb100301trp  =  public.tmptable.id_tb100301trp ;
> Error in postgresqlExecStatement(conn, statement, ...) :
> RS-DBI driver: (could not Retrieve the result : ERROR:  relation "public.tmptable" does not exist
> )
> In addition: Warning message:
> In postgresqlQuickSQL(conn, statement, ...) :
> Could not create executeUPDATE  au08_100301.tb100301trp  SET  tripscore  =  public.tmptable.tripscore FROM public.tmptable
> WHERE  au08_100301.tb100301trp.id_tb100301trp  =  public.tmptable.id_tb100301trp ;
> Error in postgresqlExecStatement(conn, statement, ...) :
> RS-DBI driver: (could not Retrieve the result : ERROR:  relation "public.tmptable" does not exist
> )
> In addition: Warning message:
> In postgresqlQuickSQL(conn, statement, ...) :
> Could not create executeUPDATE  au08_100301.tb100301trp  SET  stflag  =  public.tmptable.stflag FROM public.tmptable
> WHERE  au08_100301.tb100301trp.id_tb100301trp  =  public.tmptable.id_tb100301trp ;
> Error in postgresqlExecStatement(conn, statement, ...) :
> RS-DBI driver: (could not Retrieve the result : ERROR:  relation "public.tmptable" does not exist
> )
> In addition: Warning message:
> In postgresqlQuickSQL(conn, statement, ...) :
> Could not create executeUPDATE  au08_100301.tb100301trp  SET  hrflag  =  public.tmptable.hrflag FROM public.tmptable
> WHERE  au08_100301.tb100301trp.id_tb100301trp  =  public.tmptable.id_tb100301trp ;
> 
> 
> 
> ***********************************************
> Hu, Zhengyu (Rex)
> Department of Statistics
> The Ohio State University
> Columbus, OH 43210
> 
> _______________________________________________
> R-sig-DB mailing list -- R Special Interest Group
> R-sig-DB using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-db


	[[alternative HTML version deleted]]




More information about the R-sig-DB mailing list