QuickBooks/Driver/Sql/Pgsql.php
protected function _connect($host, $port, $user, $pass, $db, $new_link, $client_flags = null)
	{
		$this->_schema = null;
		
		$tmp = array();
		
		if ($host)
		{
			$tmp[] = 'host=' . $host;
		}
		
		if ((int) $port)
		{
			$tmp[] = 'port=' . (int) $port;
		}
		
		if ($user)
		{
			$tmp[] = 'user=' . $user;
		}
		
		if ($pass)
		{
			$tmp[] = 'password=' . $pass;
		}
			
		if ($db)
		{
			if (false !== strpos($db, '.'))
			{
				$explode = explode('.', $db);
				
				//$tmp[] = 'schema=' . $explode[0];
				
				$this->_schema = $explode[1];
				
				$tmp[] = 'dbname=' . $explode[0];
			}
			else
			{
				$tmp[] = 'dbname=' . $db;
			}
		}
		
		$str = implode(' ', $tmp);
		
		if ($new_link)
		{
			$this->_conn = pg_connect($str, PGSQL_CONNECT_FORCE_NEW);
		}
		else
		{
			$this->_conn = pg_connect($str);
		}
		
		if ($this->_schema)
		{
			//print('SETTING HERE: [' . $this->_schema . ']');
			
			$errnum = 0;
			$errmsg = null;
			$this->_query("SET search_path TO " . $this->_escape($this->_schema) . ', public', $errnum, $errmsg);
		}
		else
		{
			// Default to using the 'public' schema
			$this->_schema = 'public';
		}
		
		//$errnum = 0;
		//$errmsg = null;
		//print_r($this->_fetch($this->_query("SHOW search_path", $errnum, $errmsg)));
		//die('SCHEMA IS: ' . $this->_schema);
	}
protected function _connect($host, $port, $user, $pass, $db, $new_link, $client_flags = null)
	{
		$this->_schema = null;
		
		$tmp = array();
		
		if ($host)
		{
			$tmp[] = 'host=' . $host;
		}
		
		if ((int) $port)
		{
			$tmp[] = 'port=' . (int) $port;
		}
		
		if ($user)
		{
			$tmp[] = 'user=' . $user;
		}
		
		if ($pass)
		{
			$tmp[] = 'password=' . $pass;
		}
			
		if ($db)
		{
			if (false !== strpos($db, '.'))
			{
				$explode = explode('.', $db);
				
				//$tmp[] = 'schema=' . $explode[0];
				
				$this->_schema = $explode[1];
				
				$tmp[] = 'dbname=' . $explode[0];
			}
			else
			{
				$tmp[] = 'dbname=' . $db;
			}
		}
		
		$str = implode(' ', $tmp);
		
		if ($new_link)
		{
			$this->_conn = pg_connect($str, PGSQL_CONNECT_FORCE_NEW);
		}
		else
		{
			$this->_conn = pg_connect($str);
		}
		
		if ($this->_schema)
		{
			//print('SETTING HERE: [' . $this->_schema . ']');
			
			$errnum = 0;
			$errmsg = null;
			$this->_query("SET search_path TO " . $this->_escape($this->_schema) . ', public', $errnum, $errmsg);
		}
		else
		{
			// Default to using the 'public' schema
			$this->_schema = 'public';
		}
		
		//$errnum = 0;
		//$errmsg = null;
		//print_r($this->_fetch($this->_query("SHOW search_path", $errnum, $errmsg)));
		//die('SCHEMA IS: ' . $this->_schema);
	}
Connect to the database

@param string $host				The hostname the database is located at
@param integer $port				The port the database is at
@param string $user				Username for connecting
@param string $pass				Password for connecting
@param string $db				The database name
@param boolean $new_link			TRUE for establishing a new link to the database, FALSE to re-use an existing one
@param integer $client_flags		Database connection flags (see the PHP/MySQL documentation)
@return boolean