TYPO3 CMS  TYPO3_7-6
ADODB_postgres64 Class Reference
Inheritance diagram for ADODB_postgres64:
ADODB_netezza ADODB_postgres7 ADODB_postgres8 ADODB_postgres9

Public Member Functions

 __construct ()
 
 ServerInfo ()
 
 IfNull ( $field, $ifNull)
 
 pg_insert_id ($tablename, $fieldname)
 
 _insertid ($table, $column)
 
 _affectedrows ()
 
 BeginTrans ()
 
 RowLock ($tables, $where, $col='1 as adodbignore')
 
 CommitTrans ($ok=true)
 
 RollbackTrans ()
 
 MetaTables ($ttype=false, $showSchema=false, $mask=false)
 
 qstr ($s, $magic_quotes=false)
 
 SQLDate ($fmt, $col=false)
 
 UpdateBlobFile ($table, $column, $path, $where, $blobtype='BLOB')
 
 BlobDelete ( $blob)
 
 GuessOID ($oid)
 
 BlobDecode ($blob, $maxsize=false, $hastrans=true)
 
 BlobEncode ($blob)
 
 UpdateBlob ($table, $column, $val, $where, $blobtype='BLOB')
 
 OffsetDate ($dayFraction, $date=false)
 
 MetaColumns ($table, $normalize=true)
 
 Param ($name, $type='C')
 
 MetaIndexes ($table, $primary=FALSE, $owner=false)
 
 _connect ($str, $user='', $pwd='', $db='', $ctype=0)
 
 _nconnect ($argHostname, $argUsername, $argPassword, $argDatabaseName)
 
 _pconnect ($str, $user='', $pwd='', $db='')
 
 _query ($sql, $inputarr=false)
 
 _errconnect ()
 
 ErrorMsg ()
 
 ErrorNo ()
 
 _close ()
 
 CharMax ()
 
 TextMax ()
 

Public Attributes

 $databaseType = 'postgres64'
 
 $dataProvider = 'postgres'
 
 $hasInsertID = true
 
 $_resultid = false
 
 $concat_operator ='||'
 
 $metaDatabasesSQL = "select datname from pg_database where datname not in ('template0','template1') order by 1"
 
 $metaTablesSQL
 
 $isoDates = true
 
 $sysDate = "CURRENT_DATE"
 
 $sysTimeStamp = "CURRENT_TIMESTAMP"
 
 $blobEncodeType = 'C'
 
 $metaColumnsSQL
 
 $metaColumnsSQL1
 
 $metaKeySQL
 
 $hasAffectedRows = true
 
 $hasLimit = false
 
 $true = 'TRUE'
 
 $false = 'FALSE'
 
 $fmtDate = "'Y-m-d'"
 
 $fmtTimeStamp = "'Y-m-d H:i:s'"
 
 $hasMoveFirst = true
 
 $hasGenID = true
 
 $_genIDSQL = "SELECT NEXTVAL('%s')"
 
 $_genSeqSQL = "CREATE SEQUENCE %s START %s"
 
 $_dropSeqSQL = "DROP SEQUENCE %s"
 
 $metaDefaultsSQL = "SELECT d.adnum as num, d.adsrc as def from pg_attrdef d, pg_class c where d.adrelid=c.oid and c.relname='%s' order by d.adnum"
 
 $random = 'random()'
 
 $autoRollback = true
 random function More...
 
 $uniqueIisR = true
 
 $_bindInputArray = false
 
 $disableBlobs = false
 
 $_pnum = 0
 

Protected Member Functions

 _generateMetaColumnsSQL ($table, $schema)
 

Detailed Description

Definition at line 59 of file adodb-postgres64.inc.php.

Constructor & Destructor Documentation

◆ __construct()

ADODB_postgres64::__construct ( )

Definition at line 127 of file adodb-postgres64.inc.php.

Member Function Documentation

◆ _affectedrows()

ADODB_postgres64::_affectedrows ( )

Definition at line 173 of file adodb-postgres64.inc.php.

◆ _close()

ADODB_postgres64::_close ( )

Definition at line 878 of file adodb-postgres64.inc.php.

References RollbackTrans().

◆ _connect()

ADODB_postgres64::_connect (   $str,
  $user = '',
  $pwd = '',
  $db = '',
  $ctype = 0 
)

Definition at line 691 of file adodb-postgres64.inc.php.

References $host, $pwd, adodb_addslashes(), and ServerInfo().

Referenced by _nconnect(), and _pconnect().

◆ _errconnect()

ADODB_postgres64::_errconnect ( )

Definition at line 842 of file adodb-postgres64.inc.php.

Referenced by ErrorMsg().

◆ _generateMetaColumnsSQL()

ADODB_postgres64::_generateMetaColumnsSQL (   $table,
  $schema 
)
protected

Generate the SQL to retrieve MetaColumns data

Parameters
string$tableTable name
string$schemaSchema name (can be blank)
Returns
string SQL statement to execute

Definition at line 483 of file adodb-postgres64.inc.php.

◆ _insertid()

ADODB_postgres64::_insertid (   $table,
  $column 
)

Warning from http://www.php.net/manual/function.pg-getlastoid.php: 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.

Definition at line 165 of file adodb-postgres64.inc.php.

◆ _nconnect()

ADODB_postgres64::_nconnect (   $argHostname,
  $argUsername,
  $argPassword,
  $argDatabaseName 
)

Definition at line 749 of file adodb-postgres64.inc.php.

References _connect().

◆ _pconnect()

ADODB_postgres64::_pconnect (   $str,
  $user = '',
  $pwd = '',
  $db = '' 
)

Definition at line 759 of file adodb-postgres64.inc.php.

References $pwd, and _connect().

◆ _query()

ADODB_postgres64::_query (   $sql,
  $inputarr = false 
)

Definition at line 766 of file adodb-postgres64.inc.php.

References $params, $sql, and qstr().

◆ BeginTrans()

ADODB_postgres64::BeginTrans ( )
Returns
true/false

Definition at line 183 of file adodb-postgres64.inc.php.

Referenced by RowLock().

◆ BlobDecode()

ADODB_postgres64::BlobDecode (   $blob,
  $maxsize = false,
  $hastrans = true 
)

Definition at line 416 of file adodb-postgres64.inc.php.

References GuessOID().

◆ BlobDelete()

ADODB_postgres64::BlobDelete (   $blob)

Definition at line 387 of file adodb-postgres64.inc.php.

◆ BlobEncode()

ADODB_postgres64::BlobEncode (   $blob)

Definition at line 440 of file adodb-postgres64.inc.php.

◆ CharMax()

ADODB_postgres64::CharMax ( )

Definition at line 894 of file adodb-postgres64.inc.php.

◆ CommitTrans()

ADODB_postgres64::CommitTrans (   $ok = true)

Definition at line 197 of file adodb-postgres64.inc.php.

References RollbackTrans().

◆ ErrorMsg()

ADODB_postgres64::ErrorMsg ( )

Definition at line 849 of file adodb-postgres64.inc.php.

References _errconnect().

Referenced by ErrorNo().

◆ ErrorNo()

ADODB_postgres64::ErrorNo ( )

Definition at line 868 of file adodb-postgres64.inc.php.

References ErrorMsg().

◆ GuessOID()

ADODB_postgres64::GuessOID (   $oid)

Definition at line 398 of file adodb-postgres64.inc.php.

Referenced by BlobDecode().

◆ IfNull()

ADODB_postgres64::IfNull (   $field,
  $ifNull 
)

Definition at line 142 of file adodb-postgres64.inc.php.

◆ MetaColumns()

ADODB_postgres64::MetaColumns (   $table,
  $normalize = true 
)

Definition at line 496 of file adodb-postgres64.inc.php.

◆ MetaIndexes()

ADODB_postgres64::MetaIndexes (   $table,
  $primary = FALSE,
  $owner = false 
)

Definition at line 620 of file adodb-postgres64.inc.php.

◆ MetaTables()

ADODB_postgres64::MetaTables (   $ttype = false,
  $showSchema = false,
  $mask = false 
)

Definition at line 214 of file adodb-postgres64.inc.php.

References $metaTablesSQL, qstr(), and ServerInfo().

◆ OffsetDate()

ADODB_postgres64::OffsetDate (   $dayFraction,
  $date = false 
)

Definition at line 463 of file adodb-postgres64.inc.php.

◆ Param()

ADODB_postgres64::Param (   $name,
  $type = 'C' 
)

Definition at line 609 of file adodb-postgres64.inc.php.

◆ pg_insert_id()

ADODB_postgres64::pg_insert_id (   $tablename,
  $fieldname 
)

Definition at line 148 of file adodb-postgres64.inc.php.

◆ qstr()

ADODB_postgres64::qstr (   $s,
  $magic_quotes = false 
)

Definition at line 247 of file adodb-postgres64.inc.php.

Referenced by _query(), and MetaTables().

◆ RollbackTrans()

ADODB_postgres64::RollbackTrans ( )

Definition at line 207 of file adodb-postgres64.inc.php.

Referenced by _close(), and CommitTrans().

◆ RowLock()

ADODB_postgres64::RowLock (   $tables,
  $where,
  $col = '1 as adodbignore' 
)

Definition at line 190 of file adodb-postgres64.inc.php.

References BeginTrans().

◆ ServerInfo()

ADODB_postgres64::ServerInfo ( )

Definition at line 132 of file adodb-postgres64.inc.php.

Referenced by _connect(), and MetaTables().

◆ SQLDate()

ADODB_postgres64::SQLDate (   $fmt,
  $col = false 
)

Definition at line 272 of file adodb-postgres64.inc.php.

References $sysTimeStamp.

◆ TextMax()

ADODB_postgres64::TextMax ( )

Definition at line 902 of file adodb-postgres64.inc.php.

◆ UpdateBlob()

ADODB_postgres64::UpdateBlob (   $table,
  $column,
  $val,
  $where,
  $blobtype = 'BLOB' 
)

Definition at line 454 of file adodb-postgres64.inc.php.

◆ UpdateBlobFile()

ADODB_postgres64::UpdateBlobFile (   $table,
  $column,
  $path,
  $where,
  $blobtype = 'BLOB' 
)

Definition at line 359 of file adodb-postgres64.inc.php.

References $rs.

Member Data Documentation

◆ $_bindInputArray

ADODB_postgres64::$_bindInputArray = false

Definition at line 114 of file adodb-postgres64.inc.php.

◆ $_dropSeqSQL

ADODB_postgres64::$_dropSeqSQL = "DROP SEQUENCE %s"

Definition at line 107 of file adodb-postgres64.inc.php.

◆ $_genIDSQL

ADODB_postgres64::$_genIDSQL = "SELECT NEXTVAL('%s')"

Definition at line 105 of file adodb-postgres64.inc.php.

◆ $_genSeqSQL

ADODB_postgres64::$_genSeqSQL = "CREATE SEQUENCE %s START %s"

Definition at line 106 of file adodb-postgres64.inc.php.

◆ $_pnum

ADODB_postgres64::$_pnum = 0

Definition at line 117 of file adodb-postgres64.inc.php.

◆ $_resultid

ADODB_postgres64::$_resultid = false

Definition at line 63 of file adodb-postgres64.inc.php.

◆ $autoRollback

ADODB_postgres64::$autoRollback = true

random function

Definition at line 110 of file adodb-postgres64.inc.php.

◆ $blobEncodeType

ADODB_postgres64::$blobEncodeType = 'C'

Definition at line 75 of file adodb-postgres64.inc.php.

◆ $concat_operator

ADODB_postgres64::$concat_operator ='||'

Definition at line 64 of file adodb-postgres64.inc.php.

◆ $databaseType

ADODB_postgres64::$databaseType = 'postgres64'

Definition at line 60 of file adodb-postgres64.inc.php.

◆ $dataProvider

ADODB_postgres64::$dataProvider = 'postgres'

Definition at line 61 of file adodb-postgres64.inc.php.

◆ $disableBlobs

ADODB_postgres64::$disableBlobs = false

Definition at line 115 of file adodb-postgres64.inc.php.

◆ $false

ADODB_postgres64::$false = 'FALSE'

Definition at line 100 of file adodb-postgres64.inc.php.

◆ $fmtDate

ADODB_postgres64::$fmtDate = "'Y-m-d'"

Definition at line 101 of file adodb-postgres64.inc.php.

◆ $fmtTimeStamp

ADODB_postgres64::$fmtTimeStamp = "'Y-m-d H:i:s'"

Definition at line 102 of file adodb-postgres64.inc.php.

◆ $hasAffectedRows

ADODB_postgres64::$hasAffectedRows = true

Definition at line 96 of file adodb-postgres64.inc.php.

◆ $hasGenID

ADODB_postgres64::$hasGenID = true

Definition at line 104 of file adodb-postgres64.inc.php.

◆ $hasInsertID

ADODB_postgres64::$hasInsertID = true

Definition at line 62 of file adodb-postgres64.inc.php.

◆ $hasLimit

ADODB_postgres64::$hasLimit = false

Definition at line 97 of file adodb-postgres64.inc.php.

◆ $hasMoveFirst

ADODB_postgres64::$hasMoveFirst = true

Definition at line 103 of file adodb-postgres64.inc.php.

◆ $isoDates

ADODB_postgres64::$isoDates = true

Definition at line 72 of file adodb-postgres64.inc.php.

◆ $metaColumnsSQL

ADODB_postgres64::$metaColumnsSQL
Initial value:
= "SELECT a.attname,t.typname,a.attlen,a.atttypmod,a.attnotnull,a.atthasdef,a.attnum
FROM pg_class c, pg_attribute a,pg_type t
WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s')) and a.attname not like '....%%'
AND a.attnum > 0 AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum"

Definition at line 76 of file adodb-postgres64.inc.php.

◆ $metaColumnsSQL1

ADODB_postgres64::$metaColumnsSQL1
Initial value:
= "SELECT a.attname, t.typname, a.attlen, a.atttypmod, a.attnotnull, a.atthasdef, a.attnum
FROM pg_class c, pg_attribute a, pg_type t, pg_namespace n
WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s'))
and c.relnamespace=n.oid and n.nspname='%s'
and a.attname not like '....%%' AND a.attnum > 0
AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum"

Definition at line 82 of file adodb-postgres64.inc.php.

◆ $metaDatabasesSQL

ADODB_postgres64::$metaDatabasesSQL = "select datname from pg_database where datname not in ('template0','template1') order by 1"

Definition at line 65 of file adodb-postgres64.inc.php.

◆ $metaDefaultsSQL

ADODB_postgres64::$metaDefaultsSQL = "SELECT d.adnum as num, d.adsrc as def from pg_attrdef d, pg_class c where d.adrelid=c.oid and c.relname='%s' order by d.adnum"

Definition at line 108 of file adodb-postgres64.inc.php.

◆ $metaKeySQL

ADODB_postgres64::$metaKeySQL
Initial value:
= "SELECT ic.relname AS index_name, a.attname AS column_name,i.indisunique AS unique_key, i.indisprimary AS primary_key
FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a
WHERE bc.oid = i.indrelid AND ic.oid = i.indexrelid
AND (i.indkey[0] = a.attnum OR i.indkey[1] = a.attnum OR i.indkey[2] = a.attnum OR i.indkey[3] = a.attnum OR i.indkey[4] = a.attnum OR i.indkey[5] = a.attnum OR i.indkey[6] = a.attnum OR i.indkey[7] = a.attnum)
AND a.attrelid = bc.oid AND bc.relname = '%s'"

Definition at line 90 of file adodb-postgres64.inc.php.

◆ $metaTablesSQL

ADODB_postgres64::$metaTablesSQL
Initial value:
= "select tablename,'T' from pg_tables where tablename not like 'pg\_%'
and tablename not in ('sql_features', 'sql_implementation_info', 'sql_languages',
'sql_packages', 'sql_sizing', 'sql_sizing_profiles')
union
select viewname,'V' from pg_views where viewname not like 'pg\_%'"

Definition at line 66 of file adodb-postgres64.inc.php.

Referenced by MetaTables().

◆ $random

ADODB_postgres64::$random = 'random()'

Definition at line 109 of file adodb-postgres64.inc.php.

◆ $sysDate

ADODB_postgres64::$sysDate = "CURRENT_DATE"

Definition at line 73 of file adodb-postgres64.inc.php.

◆ $sysTimeStamp

ADODB_postgres64::$sysTimeStamp = "CURRENT_TIMESTAMP"

Definition at line 74 of file adodb-postgres64.inc.php.

Referenced by SQLDate().

◆ $true

ADODB_postgres64::$true = 'TRUE'

Definition at line 99 of file adodb-postgres64.inc.php.

◆ $uniqueIisR

ADODB_postgres64::$uniqueIisR = true

Definition at line 113 of file adodb-postgres64.inc.php.