Dear David,
Sorry not to have responded to the issue.
I tested your example now and it appears that segfault happen only
on some old revisions.
There were a bit of change between Jan 29 and Feb 15.
https://code.google.com/p/rpostgresql/source/list
But, it includes some work related to bytea.
Below is the transcript log with the latest.
dbWriteTable does not write the bytea value, but does not segfault.
Some tiny example to INSERT and SELECT serialized data
is present in exttests/bytea.R or RPostgreSQL/test/bytea.R
The organization of test structure is the current hurdle for next release.
> library(RPostgreSQL)
Loading required package: DBI
> con<-dbConnect("PostgreSQL")
> dbGetQuery(con,"drop table byteatable")
NULL
> dbGetQuery(con,"CREATE TABLE byteatable (name text NOT NULL, val bytea, PRIMARY KEY (name))")
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "byteatable_pkey" for table "byteatable"
NULL
> sample.object <- list("one","two");
> ser <- serialize(sample.object,NULL,ascii=F);
>
> df <- data.frame(name=c("first","second"),stringsAsFactors=F);
> df$val <- list(ser,ser)
>
> dbWriteTable(con,"byteatable",df,append=T,row.names=F)
[1] TRUE
> dbGetQuery(con,"select * from byteatable")
name val
1 first
2 second
> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-unknown-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RPostgreSQL_0.5-1 DBI_0.2-7
Would you mind testing with r272?
Kind regards,
Tomoaki
> --
> You received this message because you are subscribed to the Google Groups "RPostgreSQL Development and Discussion List" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
rpostgresql-d...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.