diff --git a/system/drivers/DB_postgre.php b/system/drivers/DB_postgre.php
index fd98ec7..673dea3 100644
--- a/system/drivers/DB_postgre.php
+++ b/system/drivers/DB_postgre.php
@@ -38,9 +38,11 @@
 	 */	
 	function db_connect()
 	{
-		return pg_connect("host=".$this->hostname." dbname=".$this->database." user=".$this->username." password=".$this->password);
+		$port = ($this->port == '') ? '' : " port=".$this->port;
+		
+		return pg_connect("host=".$this->hostname.$port." dbname=".$this->database." user=".$this->username." password=".$this->password);
 	}
-	
+
 	// --------------------------------------------------------------------
 
 	/**
@@ -51,7 +53,9 @@
 	 */	
 	function db_pconnect()
 	{
-		return pg_pconnect("host=".$this->hostname." dbname=".$this->database." user=".$this->username." password=".$this->password);
+		$port = ($this->port == '') ? '' : " port=".$this->port;
+
+		return pg_pconnect("host=".$this->hostname.$port." dbname=".$this->database." user=".$this->username." password=".$this->password);
 	}
 	
 	// --------------------------------------------------------------------