Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Commit

Permalink
Fix comments on EDB packages.
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.pgadmin.org/branches/REL-1_8_0_PATCHES@7324 a7884b65-44f6-0310-8a51-81a127f17b15
  • Loading branch information
dpage committed May 29, 2008
1 parent a1e38e2 commit bc2fbb7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Changes

Date Dev Ver Change details
---------- --- ----- --------------
2008-05-29 DP 1.8.3 Fix comments on EDB packages.
2008-05-29 DP 1.8.3 Ensure the grant wizard works correctly with EDB stored
procedures.
2008-05-28 DP 1.8.3 Ensure functions in databases with non-ASCII names can be
Expand Down
9 changes: 8 additions & 1 deletion pgadmin/dlg/dlgPackage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ pgObject *dlgPackage::GetObject()

int dlgPackage::Go(bool modal)
{
txtComment->Disable();
if (!connection->EdbMinimumVersion(8, 2))
txtComment->Disable();

cbOwner->Disable();

AddGroups();
Expand Down Expand Up @@ -111,6 +113,9 @@ void dlgPackage::CheckChange()
if (!(txtBody->GetText() != package->GetBodyInner() ||
txtHeader->GetText() != package->GetHeaderInner()))
enable = false;

if (txtComment->GetValue() != package->GetComment())
enable = true;
}

EnableOK(enable);
Expand Down Expand Up @@ -158,5 +163,7 @@ wxString dlgPackage::GetSql()

sql += GetGrant(wxT("X"), wxT("PACKAGE ") + qtName);

AppendComment(sql, wxT("PACKAGE"), schema, package);

return sql;
}
11 changes: 8 additions & 3 deletions pgadmin/schema/edbPackage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ void edbPackage::ShowTreeDetail(ctlTree *browser, frmMain *form, ctlListView *pr
properties->AppendItem(_("Body"), firstLineOnly(GetBody()));
properties->AppendItem(_("ACL"), GetAcl());
properties->AppendItem(_("System package?"), GetSystemObject());
if (GetConnection()->EdbMinimumVersion(8, 2))
properties->AppendItem(_("Comment"), firstLineOnly(GetComment()));
}
}

Expand Down Expand Up @@ -163,9 +165,10 @@ pgObject *edbPackageFactory::CreateObjects(pgCollection *collection, ctlTree *br

if (collection->GetConnection()->EdbMinimumVersion(8, 2))
{
sql = wxT("SELECT oid, xmin, nspname AS pkgname, nspbodysrc AS pkgbodysrc, nspheadsrc AS pkgheadsrc,\n")
wxT(" nspacl AS pkgacl, pg_get_userbyid(nspowner) AS owner\n")
wxT(" FROM pg_namespace")
sql = wxT("SELECT nsp.oid, nsp.xmin, nspname AS pkgname, nspbodysrc AS pkgbodysrc, nspheadsrc AS pkgheadsrc,\n")
wxT(" nspacl AS pkgacl, pg_get_userbyid(nspowner) AS owner, description\n")
wxT(" FROM pg_namespace nsp")
wxT(" LEFT OUTER JOIN pg_description des ON des.objoid=nsp.oid\n")
wxT(" WHERE nspparent = ") + NumToStr(collection->GetSchema()->GetOid()) + wxT("::oid\n")
+ restriction +
wxT(" ORDER BY nspname;");
Expand Down Expand Up @@ -193,6 +196,8 @@ pgObject *edbPackageFactory::CreateObjects(pgCollection *collection, ctlTree *br
package->iSetXid(packages->GetOid(wxT("xmin")));
package->iSetDatabase(collection->GetDatabase());
package->iSetOwner(packages->GetVal(wxT("owner")));
if (collection->GetConnection()->EdbMinimumVersion(8, 2))
package->iSetComment(packages->GetVal(wxT("description")));

// EnterpriseDB's CVS code has some new parser code
// which is stricter about the formatting of body &
Expand Down

0 comments on commit bc2fbb7

Please sign in to comment.