Skip to content

Can't write table with a logical column #107

Closed

Description

@richfitz

I would expect this to successfully import

library(DBI)
con <- dbConnect(RPostgres::Postgres())
dbWriteTable(con, "tmp", data.frame(a = TRUE, b = 1))

but I get an error from the server:

Error: ERROR:  invalid input syntax for integer: "true"
CONTEXT:  COPY tmp, line 1, column a: "true"

With RSQLite, this converts to integer.

If I have an existing table with boolean columns this works fine - the import does the conversion to TRUE/FALSE values (and dbReadTable converts back to logical when reading back into R).

This is with the current master of RPostgres (d694bd4, version 0.1-2) and with postgres running in a docker container (PostgreSQL 9.6.0 on x86_64-pc-linux-gnu, compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit)

Activity

  1. github-actions commented on Dec 9, 2020

    @github-actions
    Contributor

    This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

  2. locked and limited conversation to collaborators on Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions