Class ADODB2_postgres

Description

Located in /adodb5/datadict/datadict-postgres.inc.php (line 16)

ADODB_DataDict
   |
   --ADODB2_postgres
Variable Summary
mixed $addCol
mixed $dropTable
mixed $quote
mixed $renameTable
mixed $seqField
mixed $seqPrefix
Method Summary
void ActualType ( $meta)
array AddColumnSQL (string $tabname, string $flds)
array AlterColumnSQL (string $tabname, string $flds, [string $tableflds = ''], [array/ $tableoptions = ''])
array DropColumnSQL (string $tabname, string $flds, [string $tableflds = ''], [array/ $tableoptions = ''])
void DropIndexSQL ( $idxname, [ $tabname = NULL])
void DropTableSQL ( $tabname)
void MetaType ( $t, [ $len = -1], [ $fieldobj = false])
void RenameTableSQL ( $tabname,  $newname)
void _CreateSuffix ( $fname,  &$ftype,  $fnotnull,  $fdefault,  $fautoinc,  $fconstraint)
void _DropAutoIncrement ( $tabname)
void _GetSize ( $ftype,  $ty,  $fsize,  $fprec)
void _IndexSQL ( $idxname,  $tabname,  $flds,  $idxoptions)
array _recreate_copy_table (string $tabname, string $dropflds, string $tableflds, [array/string $tableoptions = ''])
Variables
mixed $addCol = ' ADD COLUMN' (line 21)
mixed $databaseType = 'postgres' (line 18)
mixed $dropTable = 'DROP TABLE %s CASCADE' (line 24)
mixed $quote = '"' (line 22)
mixed $renameTable = 'ALTER TABLE %s RENAME TO %s' (line 23)
mixed $seqField = false (line 19)
mixed $seqPrefix = 'SEQ_' (line 20)
Methods
ActualType (line 90)
void ActualType ( $meta)
  • $meta
AddColumnSQL (line 128)

Adding a new Column

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

  • return: with SQL strings
array AddColumnSQL (string $tabname, string $flds)
  • string $tabname: table-name
  • string $flds: column-names and types for the changed columns
AlterColumnSQL (line 181)

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

  • return: with SQL strings
array AlterColumnSQL (string $tabname, string $flds, [string $tableflds = ''], [array/ $tableoptions = ''])
  • string $tabname: table-name
  • string $flds: column-name and type for the changed column
  • string $tableflds: complete defintion of the new table, eg. for postgres, default ''
  • array/ $tableoptions: options for the new table see CreateTableSQL, default ''
DropColumnSQL (line 247)

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

  • return: with SQL strings
array DropColumnSQL (string $tabname, string $flds, [string $tableflds = ''], [array/ $tableoptions = ''])
  • string $tabname: table-name
  • string $flds: column-name and type for the changed column
  • string $tableflds: complete defintion of the new table, eg. for postgres, default ''
  • array/ $tableoptions: options for the new table see CreateTableSQL, default ''
DropIndexSQL (line 155)
void DropIndexSQL ( $idxname, [ $tabname = NULL])
  • $idxname
  • $tabname
DropTableSQL (line 318)
void DropTableSQL ( $tabname)
  • $tabname
MetaType (line 26)
void MetaType ( $t, [ $len = -1], [ $fieldobj = false])
  • $t
  • $len
  • $fieldobj
RenameTableSQL (line 358)
void RenameTableSQL ( $tabname,  $newname)
  • $tabname
  • $newname
_CreateSuffix (line 329)
void _CreateSuffix ( $fname,  &$ftype,  $fnotnull,  $fdefault,  $fautoinc,  $fconstraint)
  • $fname
  • &$ftype
  • $fnotnull
  • $fdefault
  • $fautoinc
  • $fconstraint
_DropAutoIncrement (line 345)
void _DropAutoIncrement ( $tabname)
  • $tabname
_GetSize (line 437)
void _GetSize ( $ftype,  $ty,  $fsize,  $fprec)
  • $ftype
  • $ty
  • $fsize
  • $fprec
_IndexSQL (line 405)
void _IndexSQL ( $idxname,  $tabname,  $flds,  $idxoptions)
  • $idxname
  • $tabname
  • $flds
  • $idxoptions
_recreate_copy_table (line 272)

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!

  • return: with SQL strings
array _recreate_copy_table (string $tabname, string $dropflds, string $tableflds, [array/string $tableoptions = ''])
  • string $tabname: table-name
  • string $dropflds: column-names to drop
  • string $tableflds: complete defintion of the new table, eg. for postgres
  • array/string $tableoptions: options for the new table see CreateTableSQL, default ''

Documentation generated on Sun, 09 Mar 2008 23:51:37 -0300 by phpDocumentor 1.4.0

SourceForge.net Logo Support This Project