Fixed an issue where an illegal argument is showing for trigger SQL when a trigger is created for View. Fixes #6003

This commit is contained in:
Yogesh Mahajan
2020-12-02 10:55:23 +05:30
committed by Akshay Joshi
parent 64e6570f00
commit 26b3bc3f74
2 changed files with 7 additions and 3 deletions

View File

@@ -1255,10 +1255,13 @@ class ViewNode(PGChildNodeView, VacuumSettings, SchemaDiffObjectCompare):
res_rows['tfunction'] = result['rows'][0]['tfunctions']
# Format arguments
if len(res_rows['custom_tgargs']) > 1:
formatted_args = ["{0}".format(arg) for arg in
res_rows['custom_tgargs']]
if len(res_rows['custom_tgargs']) > 0:
driver = get_driver(PG_DEFAULT_DRIVER)
formatted_args = [driver.qtLiteral(arg)
for arg in res_rows['custom_tgargs']]
res_rows['tgargs'] = ', '.join(formatted_args)
else:
res_rows['tgargs'] = None
SQL = render_template("/".join(
[self.trigger_temp_path,