Python - Dynamic variable in Redshift SQL Query
问题 I'm developing in a python environment and I want to call an sql query using psycopg2 Lets say I have the following UNLOAD command in an .sql file: UNLOAD ( ' Some SQL Query ' ) TO 's3://%PATH%' ... In the sql file the %PATH% should be explicit like: 'folder1/folder3/file_name' . But I want the python program to set this %PATH% in runtime. which means that the .sql file containts something like %PATH% and will be set only in runtime. Any idea of how to do it? 回答1: You simply specify a