--- src/ui/dlgOperator.cpp.orig Mon Aug 25 11:19:47 2003 +++ src/ui/dlgOperator.cpp Mon Aug 25 14:37:08 2003 @@ -103,6 +103,7 @@ AddType(wxT(" "), oper->GetLeftTypeOid()); AddType(wxT(" "), oper->GetRightTypeOid()); + txtComment->SetValue(oper->GetComment()); txtName->Disable(); cbProcedure->Disable(); @@ -367,7 +368,18 @@ sql += wxT(");\n"); } - AppendComment(sql, wxT("OPERATOR"), schema, oper); - + if (oper->GetComment()) + { + wxString m_comm = wxT("OPERATOR ") + oper->GetFullIdentifier(); + if (oper->GetLeftType().Length() > 0) + m_comm += wxT("(") + qtIdent(oper->GetLeftType()); + else + m_comm += wxT("(NONE"); + if (oper->GetRightType().Length() > 0) + m_comm += wxT(",") + qtIdent(oper->GetRightType()) + wxT(")"); + else + m_comm += wxT(",NONE)"); + AppendComment(sql, m_comm, oper); + } return sql; } --- src/schema/pgOperator.cpp.orig Mon Aug 25 14:34:17 2003 +++ src/schema/pgOperator.cpp Mon Aug 25 14:36:49 2003 @@ -49,16 +49,23 @@ { if (sql.IsNull()) { - sql = wxT("-- Operator: ") + GetFullIdentifier() + wxT(" (") + GetLeftType() + wxT(", ") + GetRightType() + wxT(")\n\n") - + wxT("-- DROP OPERATOR ") + GetFullIdentifier(); - + sql = wxT("-- Operator: ") + GetFullIdentifier(); + if (GetLeftType().Length() > 0) + sql += wxT(" (") + qtIdent(GetLeftType()); + else + sql += wxT(") (NONE"); + if (GetRightType().Length() > 0) + sql += wxT(", ") + qtIdent(GetRightType()) + wxT(")"); + else + sql += wxT(", NONE)"); + sql += wxT("\n\n"); + sql += wxT("-- DROP OPERATOR ") + GetFullIdentifier(); if (GetLeftType().Length() > 0) sql += wxT(" (") + qtIdent(GetLeftType()); else sql += wxT(") (NONE"); - if (GetRightType().Length() > 0) - sql += wxT(", ") + qtIdent(GetLeftType()) + wxT(")"); + sql += wxT(", ") + qtIdent(GetRightType()) + wxT(")"); else sql += wxT(", NONE)"); @@ -76,8 +83,19 @@ AppendIfFilled(sql, wxT(",\n SORT2 = "), GetRightSortOperator()); AppendIfFilled(sql, wxT(",\n LTCMP = "), GetLessOperator()); AppendIfFilled(sql, wxT(",\n GTCMP = "), GetGreaterOperator()); - sql += wxT(");\n") - + GetCommentSql(); + if (GetComment() != wxT("")) + { + sql += wxT("\n COMMENT ON OPERATOR ") + GetFullIdentifier(); + if (GetLeftType().Length() > 0) + sql += wxT("(") + qtIdent(GetLeftType()); + else + sql += wxT("(NONE"); + if (GetRightType().Length() > 0) + sql += wxT(",") + qtIdent(GetRightType()) + wxT(")"); + else + sql += wxT(",NONE)"); + sql += wxT(" IS ") + qtString(GetComment()) + wxT(";\n"); + } } return sql; @@ -86,10 +104,16 @@ wxString pgOperator::GetFullName() const { - if (leftType.IsEmpty() || rightType.IsEmpty()) - return GetName() + wxT(" (") + leftType + rightType + wxT(")"); + wxString m_op = GetName(); + if (leftType.IsEmpty()) + m_op += wxT(" (NONE"); + else + m_op += wxT(" (") + leftType; + if (rightType.IsEmpty()) + m_op += wxT(",NONE)"); else - return GetName() + wxT(" (") + leftType + wxT(", ") + rightType + wxT(")"); + m_op += wxT(",") + rightType + wxT(")"); + return m_op; }