read only transaction?
When i connect to a neon endpoint, sometimes it seems to think its a read only transaction?
anyone know why and how to avoid this?
for some additional context, there are some connections to this endpoint that use read only transaction mode, but freshly created connections seem to also be created in read only mode for some reason. with other postgres databases, new connections are not created in read only mode (i.e. read only mode is only per connection/session, shouldnt persist across different connections)
8 Replies
useful-bronze•13mo ago
Are you using pgbouncer? (with
-pooler connections)
I'm not familiar with how postgres handles the read-only settings, but it's possible that pgbouncer isn't cleaning it up properlyconscious-sapphireOP•13mo ago
i dont think im using any pooling, but im not positive actually
here's my createProject for the tenant. then i create a specific branch/database under that project a bit later (attaching screenshot of this part because text limit).
i dont think im using the pgbouncer connections feature? but not positive, does it look like i am?

useful-bronze•13mo ago
conscious-sapphireOP•13mo ago
yeah currently prototyping replacing rds with neon!
any recs for ways to address? thx
i need
Provisioner.K8SNeonvm for autoscaling to work, right?useful-bronze•13mo ago
Are you using the GetConnectionURI api to get the connection string?
Looking at the code, it seems that pgbouncer connections are the default there. Unfortunately missing from the docs it seems
conscious-sapphireOP•13mo ago
Ah i just noticed the connection strings im getting the hostname does have
-pooler in it!useful-bronze•13mo ago
I don't know if that flag actually does anything right now. I was under the impression we removed the K8sPod provisioner. But yes, Neonvm is autoscaling
If you set pooled to false, hopefully it gets resolved. I'll try and take a look on Monday at how this is being handled by pgbouncer
conscious-sapphireOP•13mo ago
yeah i am using
getConnectionUri method. setting pooled: false, fixed it. thanks for the quick help!