

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 Attributes | |
| $databaseType = 'postgres' | |
| $seqField = false | |
| $seqPrefix = 'SEQ_' | |
| $addCol = ' ADD COLUMN' | |
| $quote = '"' | |
| $renameTable = 'ALTER TABLE %s RENAME TO %s' | |
| $dropTable = 'DROP TABLE %s CASCADE' | |
Definition at line 16 of file datadict-postgres.inc.php.
| ADODB2_postgres::_CreateSuffix | ( | $ | fname, | |
| &$ | ftype, | |||
| $ | fnotnull, | |||
| $ | fdefault, | |||
| $ | fautoinc, | |||
| $ | fconstraint, | |||
| $ | funsigned | |||
| ) |
Reimplemented from ADODB_DataDict.
Definition at line 330 of file datadict-postgres.inc.php.
| ADODB2_postgres::_DropAutoIncrement | ( | $ | tabname | ) |
Reimplemented from ADODB_DataDict.
Definition at line 346 of file datadict-postgres.inc.php.
Referenced by DropTableSQL().

| ADODB2_postgres::_GetSize | ( | $ | ftype, | |
| $ | ty, | |||
| $ | fsize, | |||
| $ | fprec | |||
| ) |
GENERATE THE SIZE PART OF THE DATATYPE $ftype is the actual type $ty is the type defined originally in the DDL
Reimplemented from ADODB_DataDict.
Definition at line 438 of file datadict-postgres.inc.php.
| ADODB2_postgres::_IndexSQL | ( | $ | idxname, | |
| $ | tabname, | |||
| $ | flds, | |||
| $ | idxoptions | |||
| ) |
Reimplemented from ADODB_DataDict.
Definition at line 406 of file datadict-postgres.inc.php.
References $sql.
| 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 273 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().


| ADODB2_postgres::ActualType | ( | $ | meta | ) |
Returns the actual type given a character code.
C: varchar X: CLOB (character large object) or largest varchar size if CLOB is not supported C2: Multibyte varchar X2: Multibyte CLOB
B: BLOB (binary large object)
D: Date T: Date-time L: Integer field suitable for storing booleans (0 or 1) I: Integer F: Floating point number N: Numeric or decimal number
Reimplemented from ADODB_DataDict.
Definition at line 90 of file datadict-postgres.inc.php.
| 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
| string | $tabname table-name | |
| string | $flds column-names and types for the changed columns |
Reimplemented from ADODB_DataDict.
Definition at line 129 of file datadict-postgres.inc.php.
References $sql, ADODB_DataDict::_GenFields(), and ADODB_DataDict::TableName().

| 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
| 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 '' |
Reimplemented from ADODB_DataDict.
Definition at line 182 of file datadict-postgres.inc.php.
References $sql, ADODB_DataDict::_GenFields(), _recreate_copy_table(), debug(), and ADODB_DataDict::TableName().

| 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
| 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 '' |
Reimplemented from ADODB_DataDict.
Definition at line 248 of file datadict-postgres.inc.php.
References _recreate_copy_table(), and debug().

| ADODB2_postgres::DropIndexSQL | ( | $ | idxname, | |
| $ | tabname = NULL | |||
| ) |
Reimplemented from ADODB_DataDict.
Definition at line 156 of file datadict-postgres.inc.php.
References ADODB_DataDict::TableName().

| ADODB2_postgres::DropTableSQL | ( | $ | tabname | ) |
Reimplemented from ADODB_DataDict.
Definition at line 319 of file datadict-postgres.inc.php.
References $sql, and _DropAutoIncrement().
Referenced by _recreate_copy_table().


| ADODB2_postgres::MetaType | ( | $ | t, | |
| $ | len = -1, |
|||
| $ | fieldobj = false | |||
| ) |
Reimplemented from ADODB_DataDict.
Definition at line 26 of file datadict-postgres.inc.php.
| ADODB2_postgres::RenameTableSQL | ( | $ | tabname, | |
| $ | newname | |||
| ) |
Reimplemented from ADODB_DataDict.
Definition at line 359 of file datadict-postgres.inc.php.
References ADODB_DataDict::TableName().

| ADODB2_postgres::$addCol = ' ADD COLUMN' |
Reimplemented from ADODB_DataDict.
Definition at line 21 of file datadict-postgres.inc.php.
| ADODB2_postgres::$databaseType = 'postgres' |
Definition at line 18 of file datadict-postgres.inc.php.
| ADODB2_postgres::$dropTable = 'DROP TABLE %s CASCADE' |
Reimplemented from ADODB_DataDict.
Definition at line 24 of file datadict-postgres.inc.php.
| ADODB2_postgres::$quote = '"' |
Definition at line 22 of file datadict-postgres.inc.php.
| ADODB2_postgres::$renameTable = 'ALTER TABLE %s RENAME TO %s' |
Reimplemented from ADODB_DataDict.
Definition at line 23 of file datadict-postgres.inc.php.
| ADODB2_postgres::$seqField = false |
Definition at line 19 of file datadict-postgres.inc.php.
| ADODB2_postgres::$seqPrefix = 'SEQ_' |
Definition at line 20 of file datadict-postgres.inc.php.
1.7.1