You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having an issue connecting to my postgres database. I get the error "failed to connect to database: unsupported startup parameter: IntervalStyle". Running on a hosted postgres (v11) with tls. Any ideas as to why I'm getting this?
main.rs
#[async_std::main]
async fn main() -> Res<()> {
let mut pool = PgPool::new(&env::var("DATABASE_URL")?).await?;
let rows = sqlx::query!(
"SELECT title
FROM product
LIMIT 10",
)
.fetch_all(&mut pool)
.await?;
for row in rows {
println!("row {:?}", row.get("title"));
}
Ok(())
}
Cargo.toml
[dependencies]
async-std = { version = "1.4.0", features = ["attributes"] }
sqlx = { version = "0.2.0", features = ["postgres", "tls"] }
The text was updated successfully, but these errors were encountered:
Can I assume this is behind PgBouncer ? I'm guessing you're on Digital Ocean with the bouncer turned on.
If that's the case, we currently don't support PgBouncer. PgBouncer is not Postgres. They take a lot of shortcuts. They also don't support prepared statements ( to be pedantic, they do support prepared statements but only for the duration of a transaction instead of a session .. which means that you have to throw them in the garbage and not cache them as we currently do ).
We are planning on officially supporting PgBouncer in the near future. You are kind of stuck until then though unless you can disable the bouncer.
If I'm wrong on all counts, let me know. Additionally can you provide details like the output of the version() function and what hosting provider you're using?
Example of version() on my local box.
postgres=# SELECT version();
version
----------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 11.3 (Debian 11.3-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
You are exactly correct. I am using PgBouncer on Digital Ocean.
defaultdb=> SELECT version();
version
-------------------------------------------------------------------------------------------
PostgreSQL 11.6 on x86_64-pc-linux-gnu, compiled by gcc, a 863367dcd p 310a24bd77, 64-bit
(1 row)
Thanks for confirming. I'm going to close this in favor of #67. I hope you can disable the bouncer and still use SQLx in the mean time. But if not, be sure to subscribe there for updates.
I'm having an issue connecting to my postgres database. I get the error
"failed to connect to database: unsupported startup parameter: IntervalStyle"
. Running on a hosted postgres (v11) with tls. Any ideas as to why I'm getting this?main.rs
Cargo.toml
The text was updated successfully, but these errors were encountered: