Skip to content

Commit

Permalink
not writing ALTER FUNCTION ... = ... ; if used ``pg_get_functiond…
Browse files Browse the repository at this point in the history
…ef(func_oid)``
  • Loading branch information
Andrej Antonov (impulsm.work) committed Dec 18, 2015
1 parent 60d3823 commit 72f381a
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions pgadmin/schema/pgFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,16 +356,19 @@ wxString pgFunction::GetSql(ctlTree *browser)
if (!sql.Strip(wxString::both).EndsWith(wxT(";")))
sql += wxT(";");

size_t i;
for (i = 0 ; i < configList.GetCount() ; i++)
if (functionDefByPgTrim.IsEmpty())
{
if (configList.Item(i).BeforeFirst('=') != wxT("search_path") &&
configList.Item(i).BeforeFirst('=') != wxT("temp_tablespaces"))
sql += wxT("\nALTER FUNCTION ") + qtSig
+ wxT(" SET ") + configList.Item(i).BeforeFirst('=') + wxT("='") + configList.Item(i).AfterFirst('=') + wxT("';\n");
else
sql += wxT("\nALTER FUNCTION ") + qtSig
+ wxT(" SET ") + configList.Item(i).BeforeFirst('=') + wxT("=") + configList.Item(i).AfterFirst('=') + wxT(";\n");
size_t i;
for (i = 0 ; i < configList.GetCount() ; i++)
{
if (configList.Item(i).BeforeFirst('=') != wxT("search_path") &&
configList.Item(i).BeforeFirst('=') != wxT("temp_tablespaces"))
sql += wxT("\nALTER FUNCTION ") + qtSig
+ wxT(" SET ") + configList.Item(i).BeforeFirst('=') + wxT("='") + configList.Item(i).AfterFirst('=') + wxT("';\n");
else
sql += wxT("\nALTER FUNCTION ") + qtSig
+ wxT(" SET ") + configList.Item(i).BeforeFirst('=') + wxT("=") + configList.Item(i).AfterFirst('=') + wxT(";\n");
}
}

sql += wxT("\n")
Expand Down

0 comments on commit 72f381a

Please sign in to comment.