Changing Environment in Postgres Resource

I configured my resource for production and staging and on switching it in app I see that my resource changes from prod to staging but this only works in GUI mode in postgres, if I use SQL Mode than toggling the environment doesn't work and I also tried toggling the db name in temporary state as per the environment to bypass this issue and giving that temporary state value in my sql query's db name but than it gives error at $1, so how do I toggle env in postgres SQL Mode?

Hey @tirthesh-bohra welcome to the community! Appreciate your patience here -- I'll ask internally if there's a way for you to be able to do this.

Hi @tirthesh-bohra, Do you see any errors in Retool's UI or in your browser console when you try to toggle the environment in SQL mode? Can you also clarify what you mean when you say that toggling doesn't work? Are you unable to click staging with your query set to SQL mode or when you click staging does your query switch back to GUI mode? Let us know!

@everett_smith Basically when I click staging it doesn't switch my SQL mode queries to staging or production for that matter, you can check out the below screenshots to get an idea what I'm talking about.

Hi @tirthesh-bohra, Have you configured a staging environment on your Prod_Postgres resource?

Hi @everett_smith, yes staging is configured for that particular resource and switching to staging working is GUI mode of the query but not in SQL mode.

Okay, thank you @tirthesh-bohra! Can you also confirm that 'Show write GUI mode only' isn't set on the resource configuration page of the staging resource?