TYPO3 CMS  TYPO3_7-6
ADODB2_postgres Class Reference
Inheritance diagram for ADODB2_postgres:
ADODB_DataDict

Public Member Functions

 MetaType ($t, $len=-1, $fieldobj=false)
 
 ActualType ($meta)
 
 AddColumnSQL ($tabname, $flds)
 
 DropIndexSQL ($idxname, $tabname=NULL)
 
 AlterColumnSQL ($tabname, $flds, $tableflds='', $tableoptions='')
 
 DropColumnSQL ($tabname, $flds, $tableflds='', $tableoptions='')
 
 _recreate_copy_table ($tabname, $dropflds, $tableflds, $tableoptions='')
 
 DropTableSQL ($tabname)
 
 _CreateSuffix ($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned)
 
 _DropAutoIncrement ($tabname)
 
 RenameTableSQL ($tabname, $newname)
 
 _IndexSQL ($idxname, $tabname, $flds, $idxoptions)
 
 _GetSize ($ftype, $ty, $fsize, $fprec)
 
- Public Member Functions inherited from ADODB_DataDict
 GetCommentSQL ($table, $col)
 
 SetCommentSQL ($table, $col, $cmt)
 
 MetaTables ()
 
 MetaColumns ($tab, $upper=true, $schema=false)
 
 MetaPrimaryKeys ($tab, $owner=false, $intkey=false)
 
 MetaIndexes ($table, $primary=false, $owner=false)
 
 MetaType ($t, $len=-1, $fieldobj=false)
 
 NameQuote ($name=NULL, $allowBrackets=false)
 
 TableName ($name)
 
 ExecuteSQLArray ($sql, $continueOnError=true)
 
 ActualType ($meta)
 
 CreateDatabase ($dbname, $options=false)
 
 CreateIndexSQL ($idxname, $tabname, $flds, $idxoptions=false)
 
 DropIndexSQL ($idxname, $tabname=NULL)
 
 SetSchema ($schema)
 
 AddColumnSQL ($tabname, $flds)
 
 AlterColumnSQL ($tabname, $flds, $tableflds='', $tableoptions='')
 
 RenameColumnSQL ($tabname, $oldcolumn, $newcolumn, $flds='')
 
 DropColumnSQL ($tabname, $flds, $tableflds='', $tableoptions='')
 
 DropTableSQL ($tabname)
 
 RenameTableSQL ($tabname, $newname)
 
 CreateTableSQL ($tabname, $flds, $tableoptions=array())
 
 _GenFields ($flds, $widespacing=false)
 
 _GetSize ($ftype, $ty, $fsize, $fprec)
 
 _CreateSuffix ($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned)
 
 _IndexSQL ($idxname, $tabname, $flds, $idxoptions)
 
 _DropAutoIncrement ($tabname)
 
 _TableSQL ($tabname, $lines, $pkey, $tableoptions)
 
 _Triggers ($tabname, $taboptions)
 
 _Options ($opts)
 
 _getSizePrec ($size)
 
 ChangeTableSQL ($tablename, $flds, $tableoptions=false, $dropOldFlds=false)
 

Public Attributes

 $databaseType = 'postgres'
 
 $seqField = false
 
 $seqPrefix = 'SEQ_'
 
 $addCol = ' ADD COLUMN'
 
 $quote = '"'
 
 $renameTable = 'ALTER TABLE %s RENAME TO %s'
 
 $dropTable = 'DROP TABLE %s CASCADE'
 
 $blobNotNull = true
 
 $blobDefaults = true
 
- Public Attributes inherited from ADODB_DataDict
 $connection
 
 $debug = false
 
 $dropTable = 'DROP TABLE %s'
 
 $renameTable = 'RENAME TABLE %s TO %s'
 
 $dropIndex = 'DROP INDEX %s'
 
 $addCol = ' ADD'
 
 $alterCol = ' ALTER COLUMN'
 
 $dropCol = ' DROP COLUMN'
 
 $renameColumn = 'ALTER TABLE %s RENAME COLUMN %s TO %s'
 
 $nameRegex = '\w'
 
 $nameRegexBrackets = 'a-zA-Z0-9_\(\)'
 
 $schema = false
 
 $serverInfo = array()
 
 $autoIncrement = false
 
 $dataProvider
 
 $invalidResizeTypes4 = array('CLOB','BLOB','TEXT','DATE','TIME')
 
 $blobNotNull = false
 
 $blobDefaults = false
 
 $blobSize = 100
 

Detailed Description

Definition at line 18 of file datadict-postgres.inc.php.

Member Function Documentation

◆ _CreateSuffix()

ADODB2_postgres::_CreateSuffix (   $fname,
$ftype,
  $fnotnull,
  $fdefault,
  $fautoinc,
  $fconstraint,
  $funsigned 
)

Definition at line 369 of file datadict-postgres.inc.php.

◆ _DropAutoIncrement()

ADODB2_postgres::_DropAutoIncrement (   $tabname)

Definition at line 385 of file datadict-postgres.inc.php.

Referenced by DropTableSQL().

◆ _GetSize()

ADODB2_postgres::_GetSize (   $ftype,
  $ty,
  $fsize,
  $fprec 
)

Definition at line 477 of file datadict-postgres.inc.php.

◆ _IndexSQL()

ADODB2_postgres::_IndexSQL (   $idxname,
  $tabname,
  $flds,
  $idxoptions 
)

Definition at line 445 of file datadict-postgres.inc.php.

References $sql.

◆ _recreate_copy_table()

ADODB2_postgres::_recreate_copy_table (   $tabname,
  $dropflds,
  $tableflds,
  $tableoptions = '' 
)

Save the content into a temp. table, drop and recreate the original table and copy the content back in

We also take care to set the values of the sequenz and recreate the indexes. All this is done in a transaction, to not loose the content of the table, if something went wrong!

Definition at line 312 of file datadict-postgres.inc.php.

References ADODB_DataDict\CreateIndexSQL(), ADODB_DataDict\CreateTableSQL(), DropTableSQL(), ADODB_DataDict\MetaColumns(), and ADODB_DataDict\MetaIndexes().

Referenced by AlterColumnSQL(), and DropColumnSQL().

◆ ActualType()

ADODB2_postgres::ActualType (   $meta)

Definition at line 94 of file datadict-postgres.inc.php.

◆ AddColumnSQL()

ADODB2_postgres::AddColumnSQL (   $tabname,
  $flds 
)

Adding a new Column

reimplementation of the default function as postgres does NOT allow to set the default in the same statement

Parameters
string$tabnametable-name
string$fldscolumn-names and types for the changed columns
Returns
array with SQL strings

Definition at line 133 of file datadict-postgres.inc.php.

References $sql, ADODB_DataDict\_GenFields(), and ADODB_DataDict\TableName().

◆ AlterColumnSQL()

ADODB2_postgres::AlterColumnSQL (   $tabname,
  $flds,
  $tableflds = '',
  $tableoptions = '' 
)

Change the definition of one column

Postgres can't do that on it's own, you need to supply the complete defintion of the new table, to allow, recreating the table and copying the content over to the new table

Parameters
string$tabnametable-name
string$fldscolumn-name and type for the changed column
string$tablefldscomplete defintion of the new table, eg. for postgres, default ''
array/$tableoptions options for the new table see CreateTableSQL, default ''
Returns
array with SQL strings

Definition at line 187 of file datadict-postgres.inc.php.

References $sql, ADODB_DataDict\_GenFields(), _recreate_copy_table(), debug(), ADODB_DataDict\MetaColumns(), and ADODB_DataDict\TableName().

◆ DropColumnSQL()

ADODB2_postgres::DropColumnSQL (   $tabname,
  $flds,
  $tableflds = '',
  $tableoptions = '' 
)

Drop one column

Postgres < 7.3 can't do that on it's own, you need to supply the complete defintion of the new table, to allow, recreating the table and copying the content over to the new table

Parameters
string$tabnametable-name
string$fldscolumn-name and type for the changed column
string$tablefldscomplete defintion of the new table, eg. for postgres, default ''
array/$tableoptions options for the new table see CreateTableSQL, default ''
Returns
array with SQL strings

Definition at line 287 of file datadict-postgres.inc.php.

References _recreate_copy_table(), debug(), and ADODB_DataDict\DropColumnSQL().

◆ DropIndexSQL()

ADODB2_postgres::DropIndexSQL (   $idxname,
  $tabname = NULL 
)

Definition at line 161 of file datadict-postgres.inc.php.

References ADODB_DataDict\TableName().

◆ DropTableSQL()

ADODB2_postgres::DropTableSQL (   $tabname)

◆ MetaType()

ADODB2_postgres::MetaType (   $t,
  $len = -1,
  $fieldobj = false 
)

Definition at line 30 of file datadict-postgres.inc.php.

◆ RenameTableSQL()

ADODB2_postgres::RenameTableSQL (   $tabname,
  $newname 
)

Member Data Documentation

◆ $addCol

ADODB2_postgres::$addCol = ' ADD COLUMN'

Definition at line 23 of file datadict-postgres.inc.php.

◆ $blobDefaults

ADODB2_postgres::$blobDefaults = true

Definition at line 28 of file datadict-postgres.inc.php.

◆ $blobNotNull

ADODB2_postgres::$blobNotNull = true

Definition at line 27 of file datadict-postgres.inc.php.

◆ $databaseType

ADODB2_postgres::$databaseType = 'postgres'

Definition at line 20 of file datadict-postgres.inc.php.

◆ $dropTable

ADODB2_postgres::$dropTable = 'DROP TABLE %s CASCADE'

Definition at line 26 of file datadict-postgres.inc.php.

◆ $quote

ADODB2_postgres::$quote = '"'

Definition at line 24 of file datadict-postgres.inc.php.

◆ $renameTable

ADODB2_postgres::$renameTable = 'ALTER TABLE %s RENAME TO %s'

Definition at line 25 of file datadict-postgres.inc.php.

◆ $seqField

ADODB2_postgres::$seqField = false

Definition at line 21 of file datadict-postgres.inc.php.

◆ $seqPrefix

ADODB2_postgres::$seqPrefix = 'SEQ_'

Definition at line 22 of file datadict-postgres.inc.php.