diff --git a/pgadmin/schema/pgCatalogObject.cpp b/pgadmin/schema/pgCatalogObject.cpp
index d535921..751f5a7 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 9c02fc9..11dbf9a 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")));
