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

Open
artemklevtsov opened this issue Apr 18, 2018 · 5 comments
Open

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

artemklevtsov opened this issue Apr 18, 2018 · 5 comments

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

@krlmlr krlmlr commented Dec 17, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.