reactive-pg-client icon indicating copy to clipboard operation
reactive-pg-client copied to clipboard

Connection in read-only mode

Open rac021 opened this issue 5 years ago • 8 comments

Hi,

Is there a way to put the connection in read-only mode ?

Thank's

rac021 avatar Feb 20 '20 22:02 rac021

What is connection read-only mode in Postgres? Do you mean read-only transactions(https://www.postgresql.org/docs/current/sql-set-transaction.html)?

BillyYccc avatar Feb 21 '20 10:02 BillyYccc

Yes, this is what I mean

rac021 avatar Feb 21 '20 10:02 rac021

Have you tried scheduling a query to control it directly?

BillyYccc avatar Feb 21 '20 10:02 BillyYccc

What I am currently doing is adding "SET TRANSACTION READ ONLY" for each Sql query. I want to do this using the client API. Is it possible ?

Thank's

rac021 avatar Feb 21 '20 10:02 rac021

There's no specific API for this, I wonder does it make any difference between calling such an API and a query :-)

BillyYccc avatar Feb 21 '20 10:02 BillyYccc

I mean , open transations in read only mode using reactive-pg-client ;-)

rac021 avatar Feb 21 '20 10:02 rac021

I agreed we could add such APIs for the transactions characteristics, you can check the https://github.com/eclipse-vertx/vertx-sql-client/issues/432

BillyYccc avatar Feb 21 '20 10:02 BillyYccc

It would be interesting ( at least for me :-) )

Thank you

rac021 avatar Feb 21 '20 10:02 rac021