Skip to content

Can't connection to the server with disabled prepare statements #185

Closed

Description

@artemklevtsov

Hi,

I can't connect to the server with following command:

con <- DBI::dbConnect(
    drv = RPostgres::Postgres(),
    host = "10.10.0.1",
    port = 5432,
    dbname = "postgres",
    user = "user",
    password = "1368798451"
)
#> Error in result_create(conn@ptr, statement) :
#>   Failed to retrieve query result metadata: ERROR:  unnamed prepared statement does not exist

With odbc package the connection works only with UseServerSidePrepare = No option in .odbc.ini. RPostgreSQL works without additional manipulations.

Server info:

PostgreSQL 9.3.20 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4, 64-bit
packageVersion("RPostgres")
#> [1] '1.1.0'

Activity

  1. krlmlr commented on Apr 18, 2018

    @krlmlr
    Member

    Interesting. RPostgres uses prepared statements by default, this might explain what we're seeing. Could this be a configuration issue on the server side?

  2. artemklevtsov commented on Aug 1, 2018

    @artemklevtsov
    Author

    Server's admin confirmed that the prepared statements disable on the server side. This was done to prevent performance problems.
    So can you provide fallback mode for this case?

  3. krlmlr commented on Aug 1, 2018

    @krlmlr
    Member

    Unfortunately, RPostgres currently requires prepared statements, I'm not aware of a fallback mode. Not sure what's needed to provide one either.

    How do I disable prepared statements on the server for testing?

  4. artemklevtsov commented on Oct 8, 2018

    @artemklevtsov
    Author

    I could not find information about disable the prepare statements.

  5. changed the title [-]Can't connection to the server[/-] [+]Can't connection to the server with disabled prepare statements[/+] on Oct 8, 2018
  6. krlmlr commented on Dec 17, 2019

    @krlmlr
    Member

    This will be fixed once we have support for the immediate argument to dbGetQuery() and dbSendQuery().

  7. added this to the 1.2.2 milestone on Dec 26, 2020
  8. krlmlr commented on Dec 26, 2020

    @krlmlr
    Member

    Now discussed in #272.

  9. github-actions commented on Dec 27, 2021

    @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.

  10. locked and limited conversation to collaborators on Dec 27, 2021
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions