system/Database/Postgre/Connection.php
public function escape($str)
	{
		if (! $this->connID)
		{
			$this->initialize();
		}

		if (is_string($str) || ( is_object($str) && method_exists($str, '__toString')))
		{
			return pg_escape_literal($this->connID, $str);
		}
		elseif (is_bool($str))
		{
			return $str ? 'TRUE' : 'FALSE';
		}

		return parent::escape($str);
	}
public function escape($str)
	{
		if (! $this->connID)
		{
			$this->initialize();
		}

		if (is_string($str) || ( is_object($str) && method_exists($str, '__toString')))
		{
			return pg_escape_literal($this->connID, $str);
		}
		elseif (is_bool($str))
		{
			return $str ? 'TRUE' : 'FALSE';
		}

		return parent::escape($str);
	}
"Smart" Escape String

Escapes data based on type

@param  mixed $str
@return mixed