some more PostgreSQL stuff from ADOdb 5.11

This commit is contained in:
Ralf Becker
2011-04-10 15:06:22 +00:00
parent 18b818bd57
commit 524b5d081b
2 changed files with 118 additions and 49 deletions

View File

@ -152,7 +152,7 @@ WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s'))
Using a OID as a unique identifier is not generally wise.
Unless you are very careful, you might end up with a tuple having
a different OID if a database must be reloaded. */
function _insertid($table,$column,$try_oid=true)
function _insertid($table,$column,$try_oid=false)
{
if ($try_oid)
{
@ -257,20 +257,20 @@ select viewname,'V' from pg_views where viewname like $mask";
function qstr($s,$magic_quotes=false)
{
if (is_bool($s)) return $s ? 'true' : 'false';
if (!$magic_quotes) {
if (ADODB_PHPVER >= 0x5200) {
return "'".pg_escape_string($this->_connectionID,$s)."'";
}
}
if (ADODB_PHPVER >= 0x4200) {
return "'".pg_escape_string($s)."'";
}
if ($this->replaceQuote[0] == '\\'){
$s = adodb_str_replace(array('\\',"\0"),array('\\\\',"\\\\000"),$s);
}
return "'".str_replace("'",$this->replaceQuote,$s)."'";
return "'".str_replace("'",$this->replaceQuote,$s)."'";
}
// undo magic quotes for "
$s = str_replace('\\"','"',$s);
return "'$s'";