Found a strange behaviour. I am trying to append a number of rows to an existing postgresql table with R. The new rows are to be appended to the table.
dbWriteTable(con,name = "public.MyTab",value = data,row.names=F,overwrite=F, append=T)
It returns TRUE
and no errors and thus I assume that the copying has worked. However when I execute in my opened Terminal (psql
) the following command:
SELECT count(*) from MyTab;
It returns:
count
-------
0
When I then go back to R and test out
dbReadTable(con, "public.MyTab")
It shows the data correctly.
So what happened? Is the data properly in the Postgres database or not? If I insert the rows manually (INSERT INTO ...
), then the immediate Count test works as intended.