我试图使用动态SQL在postgres中运行一些查询.
例:
EXECUTE format('SELECT * from result_%s_table', quote_ident((select id from ids where condition = some_condition)))
Run Code Online (Sandbox Code Playgroud)
我必须查询一个表,其格式为result_%s_table,其中,我需要用另一个表替换正确的表名(一个id).
我收到了错误 ERROR: prepared statement "format" does not exist