I like Datagrip for writing SQL for this purpose.
I downloaded DataGrip after reading your comment, and damn, the autocomplete is just so good. It even shows me the arguments of Postgresql extensions like TimescaleDB.
This almost reads like an ad, but I just wanted to thank you for changing my life :P