diff --git a/pgadmin/debugger/dbgController.cpp b/pgadmin/debugger/dbgController.cpp
index b4f2054..66d41c5 100644
--- a/pgadmin/debugger/dbgController.cpp
+++ b/pgadmin/debugger/dbgController.cpp
@@ -60,14 +60,14 @@
 #endif
 
 const wxString  dbgController::ms_cmdDebugSPLV1(
-    wxT("SELECT edb_oid_debug(%ld, %ld)"));
+    wxT("SELECT edb_oid_debug(%lu, %lu)"));
 const wxString  dbgController::ms_cmdDebugSPLV2(
-    wxT("SELECT edb_oid_debug(%ld)"));
+    wxT("SELECT edb_oid_debug(%lu)"));
 
 const wxString  dbgController::ms_cmdDebugPLPGSQLV1(
-    wxT("SELECT plpgsql_oid_debug(%ld, %ld)"));
+    wxT("SELECT plpgsql_oid_debug(%lu, %lu)"));
 const wxString  dbgController::ms_cmdDebugPLPGSQLV2(
-    wxT("SELECT plpgsql_oid_debug(%ld)"));
+    wxT("SELECT plpgsql_oid_debug(%lu)"));
 
 const wxString dbgController::ms_cmdAttachToPort(
     wxT("SELECT * FROM pldbg_attach_to_port(%s)"));
@@ -489,8 +489,8 @@ bool dbgController::Start()
 
 		dbgTargetInfo *target = m_model->GetTarget();
 		breakpoints.Append(new dbgBreakPoint(
-		                       wxString::Format(wxT("%ld"), target->GetOid()),
-		                       wxString::Format(wxT("%ld"), target->GetPkgOid())));
+		                       wxString::Format(wxT("%lu"), target->GetOid()),
+		                       wxString::Format(wxT("%lu"), target->GetPkgOid())));
 
 		LOCKMUTEX(m_dbgThreadLock);
 		m_dbgThread->AddQuery(ms_cmdCreateListener, NULL, (long)RESULT_ID_LISTENER_CREATED);
diff --git a/pgadmin/debugger/dbgTargetInfo.cpp b/pgadmin/debugger/dbgTargetInfo.cpp
index 7200017..8cf5417 100644
--- a/pgadmin/debugger/dbgTargetInfo.cpp
+++ b/pgadmin/debugger/dbgTargetInfo.cpp
@@ -217,9 +217,9 @@ dbgTargetInfo::dbgTargetInfo(Oid _target, pgConn *_conn)
 	m_funcSignature = set->GetVal(wxT("signature"));
 	m_isFunction    = set->GetBool(wxT("isfunc"));
 	m_returnsSet    = set->GetBool(wxT("proretset"));
-	m_pkgOid        = set->GetLong(wxT("pkg"));
-	m_pkgInitOid    = set->GetLong(wxT("pkgconsoid"));
-	m_schemaOid     = set->GetLong(wxT("schema"));
+	m_pkgOid        = set->GetOid(wxT("pkg"));
+	m_pkgInitOid    = set->GetOid(wxT("pkgconsoid"));
+	m_schemaOid     = set->GetOid(wxT("schema"));
 	m_fqName        = qtIdent(m_schema) + wxT(".") +
 	                  (m_pkgOid == 0 ? wxT("") : (qtIdent(m_package) + wxT("."))) + qtIdent(m_name);
 
diff --git a/pgadmin/schema/pgCatalogObject.cpp b/pgadmin/schema/pgCatalogObject.cpp
index d948ecc..8df379c 100644
--- a/pgadmin/schema/pgCatalogObject.cpp
+++ b/pgadmin/schema/pgCatalogObject.cpp
@@ -140,7 +140,7 @@ pgObject *pgCatalogObjectFactory::CreateObjects(pgCollection *collection, ctlTre
 			}
 
 			catalog = new pgCatalogObject(collection->GetSchema(), catalogs->GetVal(wxT("relname")));
-			catalog->iSetOid(catalogs->GetLong(wxT("oid")));
+			catalog->iSetOid(catalogs->GetOid(wxT("oid")));
 			catalog->iSetOwner(catalogs->GetVal(wxT("owner")));
 			catalog->iSetComment(catalogs->GetVal(wxT("description")));
 
diff --git a/pgadmin/schema/pgRole.cpp b/pgadmin/schema/pgRole.cpp
index 80093d1..79c16cd 100644
--- a/pgadmin/schema/pgRole.cpp
+++ b/pgadmin/schema/pgRole.cpp
@@ -635,7 +635,7 @@ pgObject *pgRoleBaseFactory::CreateObjects(pgCollection *collection, ctlTree *br
 			else
 				role = new pgGroupRole(roles->GetVal(wxT("rolname")));
 			role->iSetServer(collection->GetServer());
-			role->iSetOid(roles->GetLong(wxT("oid")));
+			role->iSetOid(roles->GetOid(wxT("oid")));
 			role->iSetCanLogin(roles->GetBool(wxT("rolcanlogin")));
 			role->iSetInherits(roles->GetBool(wxT("rolinherit")));
 			role->iSetCreateRole(roles->GetBool(wxT("rolcreaterole")));
