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

Commit

Permalink
Fix an error when working with packages on EnterpriseDB in 'postgres'…
Browse files Browse the repository at this point in the history
… mode. [Ashesh Vashi]

git-svn-id: svn://svn.pgadmin.org/branches/REL-1_10_0_PATCHES@8345 a7884b65-44f6-0310-8a51-81a127f17b15
  • Loading branch information
dpage committed May 7, 2010
1 parent fdfb48a commit 543cbd6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Expand Up @@ -36,6 +36,8 @@ Changes

Date Dev Ver Change details
---------- --- ------ --------------
2010-05-07 AV 1.10.3 Fix an error when working with packages on EnterpriseDB
in 'postgres' mode.
2010-05-07 AV 1.10.3 Prevent a crash if the user cancels a restore operation.
2010-05-05 GL 1.10.3 Fix the refresh of a dropped function.
2010-04-29 AV 1.10.3 Fix a crash bug seen when closing the debugger parameter
Expand Down
19 changes: 14 additions & 5 deletions pgadmin/schema/edbPackage.cpp
Expand Up @@ -26,11 +26,20 @@ edbPackage::edbPackage(pgSchema *newSchema, const wxString& newName)

bool edbPackage::IsUpToDate()
{
wxString sql = wxT("SELECT xmin FROM edb_package WHERE oid = ") + this->GetOidStr();
if (!this->GetDatabase()->GetConnection() || this->GetDatabase()->ExecuteScalar(sql) != NumToStr(GetXid()))
return false;
else
return true;
pgConn *conn = GetDatabase()->GetConnection();
if (!conn)
return false;

wxString sql;
if(conn->EdbMinimumVersion(8, 2))
sql = wxT("SELECT xmin FROM pg_namespace WHERE oid = ") + this->GetOidStr();
else
sql = wxT("SELECT xmin FROM edb_package WHERE oid = ") + this->GetOidStr();

if (conn->ExecuteScalar(sql) != NumToStr(GetXid()))
return false;
else
return true;
}

bool edbPackage::DropObject(wxFrame *frame, ctlTree *browser, bool cascaded)
Expand Down

0 comments on commit 543cbd6

Please sign in to comment.