Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
artemklevtsov opened this issue Apr 18, 2018 · 7 comments
Closed

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

artemklevtsov opened this issue Apr 18, 2018 · 7 comments
Milestone

Comments

@artemklevtsov
Copy link

@artemklevtsov artemklevtsov commented Apr 18, 2018

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'
@krlmlr
Copy link
Member

@krlmlr krlmlr commented Apr 18, 2018

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

@artemklevtsov
Copy link
Author

@artemklevtsov artemklevtsov commented Aug 1, 2018

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?

@krlmlr
Copy link
Member

@krlmlr krlmlr commented Aug 1, 2018

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?

@artemklevtsov
Copy link
Author

@artemklevtsov artemklevtsov commented Oct 8, 2018

I could not find information about disable the prepare statements.

@artemklevtsov artemklevtsov changed the title Can't connection to the server Can't connection to the server with disabled prepare statements Oct 8, 2018
@krlmlr
Copy link
Member

@krlmlr krlmlr commented Dec 17, 2019

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

@krlmlr
Copy link
Member

@krlmlr krlmlr commented Dec 26, 2020

Now discussed in #272.

@krlmlr krlmlr closed this as completed Dec 26, 2020
@github-actions
Copy link

@github-actions github-actions bot commented Dec 27, 2021

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.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants