Redshift serverless - Django connection active all the time

34 views Asked by At

I have Django application running which connects to postgres for basic django functionality/setup. But this application also connects to Redshift serverless using psycopg2 library. The problem is that the RS serverless is always up and running which is costing a lot. Digging into the issue, I found that psycopg2 is executing below query every 5-6 seconds:

"SET datestyle TO 'ISO'" 

Looking at the psycopg library file, every time the connection is setup, a function is called conn_is_datestyle_ok. For reference: https://github.com/psycopg/psycopg2/blob/5fb59cd6eebd96e2c8a69a3a9d606534eb95abf0/psycopg/connection_int.c#L678

Is there a way we can set the parameter or any option for library not to execute this query?

0

There are 0 answers