PHP Класс Postgres, phppgadmin

Наследование: extends ADODB_base
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$_maxNameLen Max object name length
$_schema Store the current schema
$codemap encoding name is the same as its database encoding name.
$defaultprops
$extraTypes Extra "magic" types. BIGSERIAL was added in PostgreSQL 7.2.
$fkactions Foreign key stuff. First element MUST be the default.
$fkdeferrable
$fkinitial
$fkmatches
$funcprops Function properties
$help_base Default help URL
$help_page Help sub pages
$id Name of id column
$joinOps Supported join operations for use with view wizard
$langmap Map of internal language name to syntax highlighting name
$major_version
$predefined_size_types Predefined size types
$privlist of objects.
$privmap refer to.
$rule_events Rule action types
$selectOps Select operators
$triggerEvents Array of allowed trigger events
$triggerExecTimes When to execute the trigger
$triggerFrequency How often to execute the trigger
$typAlignDef The default type alignment
$typAligns Array of allowed type alignments
$typIndexDef Default index type
$typIndexes Array of allowed index types
$typStorageDef The default type storage
$typStorages Array of allowed type storage attributes

Открытые методы

Метод Описание
Postgres ( $conn ) Constructor
_encryptPassword ( $username, $password ) Helper function that computes encypted PostgreSQL passwords
_parseACL ( $acl ) : Privileges Internal function used for parsing ACLs
addCheckConstraint ( $table, $definition, $name = '' ) Adds a check constraint to a table
addColumn ( $table, $column, $type, $array, $length, $notnull, $default, $comment ) Add a new column to a table
addDomainCheckConstraint ( $domain, $definition, $name = '' ) Adds a check constraint to a domain
addForeignKey ( $table, $targschema, $targtable, $sfields, $tfields, $upd_action, $del_action, $match, $deferrable, $initially, $name = '' ) : -1 Adds a foreign key constraint to a table
addGroupMember ( $groname, $user ) Adds a group member
addPrimaryKey ( $table, $fields, $name = '', $tablespace = '' ) : -1 Adds a primary key constraint to a table
addUniqueKey ( $table, $fields, $name = '', $tablespace = '' ) : -1 Adds a unique constraint to a table
alreadyClustered ( $table ) : true test if a table has been clustered on an index
alterAggregate ( $aggrname, $aggrtype, $aggrowner, $aggrschema, $aggrcomment, $newaggrname, $newaggrowner, $newaggrschema, $newaggrcomment ) : -4 Alters an aggregate
alterColumn ( $table, $column, $name, $notnull, $oldnotnull, $default, $olddefault, $type, $length, $array, $oldtype, $comment ) : -6 Alters a column in a table
alterDatabase ( $dbName, $newName, $newOwner = '', $comment = '' ) : -4 Alters a database the multiple return vals are for postgres 8+ which support more functionality in alter database
alterDatabaseOwner ( string $dbName, string $newOwner ) : integer Changes ownership of a database This can only be done by a superuser or the owner of the database
alterDatabaseRename ( string $oldName, string $newName ) : integer Renames a database, note that this operation cannot be performed on a database that is currently being connected to
alterDomain ( $domain, $domdefault, $domnotnull, $domowner ) : -4 Alters a domain
alterSequence ( $sequence, $name, $comment, $owner = null, $schema = null, $increment = null, $minvalue = null, $maxvalue = null, $restartvalue = null, $cachevalue = null, $cycledvalue = null, $startvalue = null ) : -2 Alters a sequence
alterSequenceName ( $seqrs, $name ) Rename a sequence
alterSequenceOwner ( $seqrs, $owner ) Alter a sequence's owner
alterSequenceProps ( $seqrs, $increment, $minvalue, $maxvalue, $restartvalue, $cachevalue, $cycledvalue, $startvalue ) Alter a sequence's properties
alterSequenceSchema ( $seqrs, $schema ) Alter a sequence's schema
alterTable ( $table, $name, $owner, $schema, $comment, $tablespace ) : -2 Alter table properties
alterTableName ( $tblrs, $name = null ) Alter a table's name !\ this function is called from _alterTable which take care of escaping fields
alterTableOwner ( $tblrs, $owner = null ) Alter a table's owner !\ this function is called from _alterTable which take care of escaping fields
alterTableSchema ( $tblrs, $schema = null ) Alter a table's schema !\ this function is called from _alterTable which take care of escaping fields
alterTableTablespace ( $tblrs, $tablespace = null ) Alter a table's tablespace !\ this function is called from _alterTable which take care of escaping fields
alterTablespace ( $spcname, $name, $owner, $comment = '' ) : -4 Alters a tablespace
alterTrigger ( $table, $trigger, $name ) Alters a trigger
alterView ( $view, $name, $owner, $schema, $comment ) : -2 Alter view properties
alterViewName ( $vwrs, $name ) Rename a view
alterViewOwner ( $vwrs, $owner = null ) Alter a view's owner
alterViewSchema ( $vwrs, $schema ) Alter a view's schema
analyzeDB ( $table = '' ) Analyze a database
arrayClean ( &$arr ) : The Cleans (escapes) an array
beginDump ( ) Sets up the data object for a dump. eg. Starts the appropriate transaction, sets variables, etc.
browseQuery ( $type, $table, $query, $sortkey, $sortdir, $page, $page_size, &$max_pages ) : -5 Returns a recordset of all columns in a query. Supports paging.
browseQueryCount ( $query, $count ) : -1 Finds the number of rows that would be returned by a query.
browseRow ( $table, $key ) : A Returns a recordset of all columns in a table
changeAggregateOwner ( $aggrname, $aggrtype, $newaggrowner ) Changes the owner of an aggregate function
changeAggregateSchema ( $aggrname, $aggrtype, $newaggrschema ) Changes the schema of an aggregate function
changeFtsMapping ( $ftscfg, array $mapping, string $action, string $dictname = null ) Creates/updates/deletes FTS mapping.
changePassword ( $rolename, $password ) Changes a role's password
clean ( &$str ) : The Cleans (escapes) a string
clusterIndex ( $table = '', $index = '' ) Clusters an index
createAggregate ( $name, $basetype, $sfunc, $stype, $ffunc, $initcond, $sortop, $comment ) : -1 Creates a new aggregate in the database
createCompositeType ( $name, $fields, $field, $type, $array, $length, $colcomment, $typcomment ) : -1 Creates a new composite type in the database
createDatabase ( $database, $encoding, $tablespace = '', $comment = '', $template = 'template1', $lc_collate = '', $lc_ctype = '' ) : -2 Creates a database
createDomain ( $domain, $type, $length, $array, $notnull, $default, $check ) Creates a domain
createEnumType ( $name, $values, $typcomment ) : -2 Creates a new enum type in the database
createFtsConfiguration ( string $cfgname, string $parser = '', string $template = '', string $comment = '' ) Creates a new FTS configuration.
createFtsDictionary ( string $dictname, boolean $isTemplate = false, string $template = '', string $lexize = '', string $init = '', string $option = '', string $comment = '' ) Creates a new FTS dictionary or FTS dictionary template.
createFunction ( $funcname, $args, $returns, $definition, $language, $flags, $setof, $cost, $rows, $comment, $replace = false ) : -4 Creates a new function.
createGroup ( $groname, $users ) Creates a new group
createIndex ( $name, $table, $columns, $type, $unique, $where, $tablespace, $concurrently ) Creates an index
createRole ( $rolename, $password, $superuser, $createdb, $createrole, $inherits, $login, $connlimit, $expiry, $memberof, $members, $adminmembers ) Creates a new role
createRule ( $name, $event, $table, $where, $instead, $type, $action, $replace = false ) : -1 Creates a rule
createSchema ( $schemaname, $authorization = '', $comment = '' ) Creates a new schema.
createSequence ( $sequence, $increment, $minvalue, $maxvalue, $startvalue, $cachevalue, $cycledvalue ) Creates a new sequence
createTable ( $name, $fields, $field, $type, $array, $length, $notnull, $default, $withoutoids, $colcomment, $tblcomment, $tablespace, $uniquekey, $primarykey ) : -1 Creates a new table in the database
createTableLike ( $name, $like, $defaults = false, $constraints = false, $idx = false, $tablespace = '' ) Creates a new table in the database copying attribs and other properties from another table
createTablespace ( $spcname, $spcowner, $spcloc, $comment = '' ) Creates a tablespace
createTrigger ( $tgname, $table, $tgproc, $tgtime, $tgevent, $tgfrequency, $tgargs ) Creates a trigger
createType ( $typname, $typin, $typout, $typlen, $typdef, $typelem, $typdelim, $typbyval, $typalign, $typstorage ) Creates a new type
createUser ( $username, $password, $createdb, $createuser, $expiry, $groups ) Creates a new user
createView ( $viewname, $definition, $replace, $comment ) Creates a new view.
dbBool ( &$parameter ) Change the value of a parameter to 't' or 'f' depending on whether it evaluates to true or false
deleteRow ( $table, $key, $schema = false ) Delete a row from a table
disableTrigger ( $tgname, $table ) Disables a trigger
dropAggregate ( $aggrname, $aggrtype, $cascade ) Removes an aggregate function from the database
dropAutovacuum ( $table )
dropCheckConstraint ( $table, $name ) : -4 Drops a check constraint from a table
dropColumn ( $table, $column, $cascade ) Drops a column from a table
dropColumnDefault ( $table, $column ) Drops default value of a column
dropConstraint ( $constraint, $relation, $type, $cascade ) Removes a constraint from a relation
dropDatabase ( $database ) Drops a database
dropDomain ( $domain, $cascade ) Drops a domain.
dropDomainConstraint ( $domain, $constraint, $cascade ) Drops a domain constraint
dropFtsConfiguration ( $ftscfg, $cascade ) Drops FTS coniguration
dropFtsDictionary ( $ftsdict, $cascade ) Drops FTS dictionary
dropFunction ( $function_oid, $cascade ) Drops a function.
dropGroup ( $groname ) Removes a group
dropGroupMember ( $groname, $user ) Removes a group member
dropIndex ( $index, $cascade ) Removes an index from the database
dropOperator ( $operator_oid, $cascade ) Drops an operator
dropRole ( $rolename ) Removes a role
dropRule ( $rule, $relation, $cascade ) Removes a rule from a table OR view
dropSchema ( $schemaname, $cascade ) Drops a schema.
dropSequence ( $sequence, $cascade ) Drops a given sequence
dropTable ( $table, $cascade ) Removes a table from the database
dropTablespace ( $spcname ) Drops a tablespace
dropTrigger ( $tgname, $table, $cascade ) Drops a trigger
dropType ( $typname, $cascade ) Drops a type.
dropUser ( $username ) Removes a user
dropView ( $viewname, $cascade ) Drops a view.
dumpRelation ( $relation, $oids ) : -1 Returns a recordset of all columns in a relation. Used for data export.
editRow ( $table, $vars, $nulls, $format, $types, $keyarr ) : -1 Updates a row in a table
emptyTable ( $table ) Empties a table in the database
enableTrigger ( $tgname, $table ) Enables a trigger
endDump ( ) Ends the data object for a dump.
escapeBytea ( $data ) : Data Escapes bytea data for display on the screen
executeScript ( $name, $callback = null ) : True Executes an SQL script as a series of SQL statements. Returns the result of the final step. This is a very complicated lexer based on the REL7_4_STABLE src/bin/psql/mainloop.c lexer in the PostgreSQL source code.
fieldArrayClean ( &$arr ) : The Cleans (escapes) an array of field names
fieldClean ( &$str ) : The Cleans (escapes) an object name (eg. table, field)
findObject ( $term, $filter ) : A Searches all system catalogs to find objects that match a certain name.
formatType ( $typname, $typmod ) Formats a type correctly for display. Postgres 7.0 had no 'format_type' built-in function, and hence we need to do it manually.
formatValue ( $type, $format, $value ) : The Formats a value or expression for sql purposes
getAggregate ( $name, $basetype ) : A Gets all information for an aggregate
getAggregates ( ) : A Gets all aggregates
getAttributeNames ( $table, $atts ) : -2 Given an array of attnums and a relation, returns an array mapping attribute number to attribute name.
getAutovacuum ( ) : associative Returns all autovacuum global configuration
getCasts ( ) : All Returns a list of all casts in the database
getChangeUserSQL ( $user ) : The Returns the SQL for changing the current user
getConstraints ( $table ) : A Returns a list of all constraints on a table
getConstraintsWithFields ( $table ) : a Returns a list of all constraints on a table, including constraint name, definition, related col and referenced namespace, table and col if needed
getConversions ( ) : All Returns a list of all conversions in the database
getDatabase ( $database ) : The Return all information about a particular database
getDatabaseComment ( string $database ) : recordset Return the database comment of a db from the shared description table
getDatabaseEncoding ( ) : The Returns the current database encoding
getDatabaseOwner ( string $database ) : recordset Return the database owner of a db
getDatabases ( $currentdatabase = NULL ) : A Return all database available on the server
getDefaultWithOid ( ) : default_with_oids Returns the current default_with_oids setting
getDomain ( $domain ) : A Gets all information for a single domain
getDomainConstraints ( $domain ) : A Get domain constraints
getDomains ( ) : All Return all domains in current schema. Excludes domain constraints.
getEnumValues ( $name ) : A Get defined values for a given enum
getFtsConfigurationByName ( $ftscfg ) : FTS Return all information related to a FTS configuration
getFtsConfigurationMap ( string $ftscfg ) : RecordSet Returns the map of FTS configuration given (list of mappings (tokens) and their processing dictionaries)
getFtsConfigurations ( $all = true ) : A Returns available FTS configurations
getFtsDictionaries ( $all = true ) Returns FTS dictionaries available
getFtsDictionaryByName ( $ftsdict ) : RecordSet Return all information relating to a FTS dictionary
getFtsDictionaryTemplates ( ) Returns all FTS dictionary templates available
getFtsMappingByName ( $ftscfg, $mapping ) : FTS Return all information related to a given FTS configuration's mapping
getFtsMappings ( $ftscfg ) Return list of FTS mappings possible for given parser (specified by given configuration since configuration can only have 1 parser)
getFtsParsers ( $all = true ) : RecordSet Returns FTS parsers available
getFunction ( $function_oid ) : Function Returns all details for a particular function
getFunctionProperties ( $f ) : An Returns an array containing a function's properties
getFunctions ( $all = false, $type = null ) : All Returns a list of all functions in the database
getGroup ( $groname ) : All Return users in a specific group
getGroups ( ) : All Returns all groups in the database cluser
getHelp ( $help ) Fetch a URL (or array of URLs) for a given help page.
getHelpPages ( )
getIndexes ( $table = '', $unique = false ) : A Grabs a list of indexes for a table
getLanguages ( $all = false ) : A Gets all languages
getLinkingKeys ( $tables ) : -1 A function for getting all columns linked by foreign keys given a group of tables
getLocks ( ) : A Returns table locks information in the current database
getMemberOf ( $rolename ) : All Returns all role names which the role belongs to
getMembers ( $rolename, $admin = 'f' ) : All Returns all role names that are members of a role
getOpClasses ( ) : A Gets all opclasses
getOperator ( $operator_oid ) : Function Returns all details for a particular operator
getOperators ( ) : All Returns a list of all operators in the database
getPreparedXacts ( $database = null ) : A Returns prepared transactions information
getPrivileges ( $object, $type, $table = null ) : -3 Grabs an array of users and their privileges for an object, given its type.
getProcesses ( $database = null ) : A Returns all available process information.
getReferrers ( $table ) : A Finds the foreign keys that refer to the specified table
getRole ( $rolename ) : The Returns information about a single role
getRoles ( $rolename = '' ) : All Returns all roles in the database cluster
getRowIdentifier ( $table ) : -1 Get the fields for uniquely identifying a row in a table
getRules ( $table ) : A Returns a list of all rules on a table OR view
getSchemaByName ( $schema ) : Schema Return all information relating to a schema
getSchemas ( ) : All Return all schemas in the current database.
getSearchPath ( ) : Array Return the current schema search path
getSelectSQL ( $table, $show, $values, $ops, $orderby = [] ) : The Generates the SQL for the 'select' function
getSequence ( $sequence ) : A Returns properties of a single sequence
getSequences ( $all = false ) : A Returns all sequences in the current database
getStatsDatabase ( $database ) : A Fetches statistics for a database
getStatsIndexIO ( $table ) : A Fetches I/0 statistics for all indexes on a table
getStatsIndexTuples ( $table ) : A Fetches tuple statistics for all indexes on a table
getStatsTableIO ( $table ) : A Fetches I/0 statistics for a table
getStatsTableTuples ( $table ) : A Fetches tuple statistics for a table
getTable ( $table ) : A Returns table information
getTableAttributes ( $table, $field = '' ) : All Retrieve the attribute definition of a table
getTableAutovacuum ( $table = '' ) : A Returns all available autovacuum per table information.
getTableChildren ( $table ) : A Finds the names and schemas of child tables
getTableDefPrefix ( $table, $clean = false ) : null Returns the SQL definition for the table.
getTableDefSuffix ( $table ) : null Returns extra table definition information that is most usefully dumped after the table contents for speed and efficiency reasons
getTableParents ( $table ) : A Finds the names and schemas of parent tables (in order)
getTables ( $all = false ) : All Return all tables in current database (and schema)
getTablespace ( $spcname ) : A Retrieves a tablespace's information
getTablespaces ( $all = false ) : A Retrieves information for all tablespaces
getTrigger ( $table, $trigger ) : A Grabs a single trigger
getTriggerDef ( $trigger ) : The A helper function for getTriggers that translates an array of attribute numbers to an array of field names.
getTriggerFunctions ( ) Returns a list of all functions that can be used in triggers
getTriggers ( $table = '' ) : A Grabs a list of triggers on a table
getType ( $typname ) : Type Returns all details for a particular type
getTypes ( $all = false, $tabletypes = false, $domains = false ) : A Returns a list of all types in the database
getUser ( $username ) : The Returns information about a single user
getUsers ( ) : All Returns all users in the database cluster
getVariables ( ) : A Returns all available variable information.
getView ( $view ) : View Returns all details for a particular view
getViews ( ) : All Returns a list of all views in the database
grantRole ( $role, $rolename, $admin ) Grants membership in a role
hasAggregateSortOp ( ) Capabilities
hasAlterAggregate ( )
hasAlterColumnType ( )
hasAlterDatabase ( )
hasAlterDatabaseOwner ( )
hasAlterDatabaseRename ( )
hasAlterDomains ( )
hasAlterSchema ( )
hasAlterSchemaOwner ( )
hasAlterSequenceSchema ( )
hasAlterSequenceStart ( )
hasAlterTableSchema ( )
hasAutovacuum ( )
hasByteaHexDefault ( )
hasConcurrentIndexBuild ( )
hasCreateFieldWithConstraints ( )
hasCreateTableLike ( )
hasCreateTableLikeWithConstraints ( )
hasCreateTableLikeWithIndexes ( )
hasDatabaseCollation ( )
hasDisableTriggers ( )
hasDomainConstraints ( )
hasEnumTypes ( )
hasFTS ( )
hasForceReindex ( )
hasFunctionAlterOwner ( )
hasFunctionAlterSchema ( )
hasFunctionCosting ( )
hasFunctionGUC ( )
hasGrantOption ( )
hasMagicTypes ( )
hasNamedParams ( )
hasObjectID ( $table ) : null Checks to see whether or not a table has a unique id column
hasPrepare ( )
hasPreparedXacts ( )
hasQueryCancel ( )
hasQueryKill ( )
hasReadOnlyQueries ( )
hasRecluster ( )
hasRoles ( )
hasServerAdminFuncs ( )
hasSharedComments ( )
hasTablespaces ( )
hasUserRename ( )
hasUserSignals ( )
hasVirtualTransactionId ( )
insertRow ( $table, $fields, $values, $nulls, $format, $types ) : -1 Adds a new row to a table
isSuperUser ( $username = '' ) : True Determines whether or not a user is a super user
nextvalSequence ( $sequence ) : -1 Execute nextval on a given sequence
phpBool ( $parameter ) Change a parameter from 't' or 'f' to a boolean, (others evaluate to false)
printField ( $name, $value, $type, $extras = [] ) Outputs the HTML code for a particular field
reindex ( $type, $name, $force = false ) Rebuild indexes
renameAggregate ( $aggrschema, $aggrname, $aggrtype, $newaggrname ) Renames an aggregate function
renameColumn ( $table, $column, $newName ) Renames a column in a table
renameRole ( $rolename, $newrolename ) Renames a role
renameUser ( $username, $newname ) Renames a user
resetSequence ( $sequence ) : -1 Resets a given sequence to min value of sequence
restartSequence ( $sequence ) : -1 Restart a given sequence to its start value
revokeRole ( $role, $rolename, $admin, $type = 'RESTRICT' ) Revokes membership in a role
saveAutovacuum ( $table, $vacenabled, $vacthreshold, $vacscalefactor, $anathresold, $anascalefactor, $vaccostdelay, $vaccostlimit ) : A Returns all available autovacuum per table information.
sendSignal ( $pid, $signal ) : -1 Sends a cancel or kill command to a process
setColumnDefault ( $table, $column, $default ) Sets default value of a column
setColumnNull ( $table, $column, $state ) Sets whether or not a column can contain NULLs
setComment ( $obj_type, $obj_name, $table, $comment, $basetype = NULL ) Sets the comment for an object in the database
setFunction ( $function_oid, $funcname, $newname, $args, $returns, $definition, $language, $flags, $setof, $funcown, $newown, $funcschema, $newschema, $cost, $rows, $comment ) : -7 Updates (replaces) a function.
setPrivileges ( $mode, $type, $object, $public, $usernames, $groupnames, $privileges, $grantoption, $cascade, $table ) : -4 Grants a privilege to a user, group or public
setRenameRole ( $rolename, $password, $superuser, $createdb, $createrole, $inherits, $login, $connlimit, $expiry, $memberof, $members, $adminmembers, $memberofold, $membersold, $adminmembersold, $newrolename ) : -3 Adjusts a role's info and renames it
setRenameUser ( $username, $password, $createdb, $createuser, $expiry, $newname ) : -3 Adjusts a user's info and renames the user
setRole ( $rolename, $password, $superuser, $createdb, $createrole, $inherits, $login, $connlimit, $expiry, $memberof, $members, $adminmembers, $memberofold, $membersold, $adminmembersold ) Adjusts a role's info
setRule ( $name, $event, $table, $where, $instead, $type, $action ) : -1 Edits a rule on a table OR view
setSchema ( $schema ) Sets the current working schema. Will also set Class variable.
setSearchPath ( $paths ) : -2 Sets the current schema search path
setUser ( $username, $password, $createdb, $createuser, $expiry ) Adjusts a user's info
setView ( $viewname, $definition, $comment ) : -3 Updates a view.
setvalSequence ( $sequence, $nextvalue ) : -1 Execute setval on a given sequence
updateFtsConfiguration ( $cfgname, $comment, $name ) Alters FTS configuration
updateFtsDictionary ( $dictname, $comment, $name ) Alters FTS dictionary or dictionary template
updateSchema ( $schemaname, $comment, $name, $owner ) Updates a schema.
vacuumDB ( $table = '', $analyze = false, $full = false, $freeze = false ) Vacuums a database

Защищенные методы

Метод Описание
_alterSequence ( $seqrs, $name, $comment, $owner, $schema, $increment, $minvalue, $maxvalue, $restartvalue, $cachevalue, $cycledvalue, $startvalue ) : -7 Protected method which alter a sequence SHOULDN'T BE CALLED OUTSIDE OF A TRANSACTION
_alterTable ( $tblrs, $name, $owner, $schema, $comment, $tablespace ) : -7 Protected method which alter a table SHOULDN'T BE CALLED OUTSIDE OF A TRANSACTION
_alterView ( $vwrs, $name, $owner, $schema, $comment ) : -6 Protected method which alter a view SHOULDN'T BE CALLED OUTSIDE OF A TRANSACTION

Приватные методы

Метод Описание
advance_1 ( &$i, &$prevlen, &$thislen ) A private helper method for executeScript that advances the character by 1. In psql this is careful to take into account multibyte languages, but we don't at the moment, so this function is someone redundant, since it will always advance by 1
valid_dolquote ( $dquote ) : True Private helper method to detect a valid $foo$ quote delimiter at the start of the parameter dquote

Описание методов

Postgres() публичный Метод

Constructor
public Postgres ( $conn )
$conn The database connection

_alterSequence() защищенный Метод

Protected method which alter a sequence SHOULDN'T BE CALLED OUTSIDE OF A TRANSACTION
protected _alterSequence ( $seqrs, $name, $comment, $owner, $schema, $increment, $minvalue, $maxvalue, $restartvalue, $cachevalue, $cycledvalue, $startvalue ) : -7
$seqrs The sequence recordSet returned by getSequence()
$name The new name for the sequence
$comment The comment on the sequence
$owner The new owner for the sequence
$schema The new schema for the sequence
$increment The increment
$minvalue The min value
$maxvalue The max value
$restartvalue The starting value
$cachevalue The cache value
$cycledvalue True if cycled, false otherwise
$startvalue The sequence start value when issueing a restart
Результат -7

_alterTable() защищенный Метод

Protected method which alter a table SHOULDN'T BE CALLED OUTSIDE OF A TRANSACTION
protected _alterTable ( $tblrs, $name, $owner, $schema, $comment, $tablespace ) : -7
$tblrs The table recordSet returned by getTable()
$name The new name for the table
$owner The new owner for the table
$schema The new schema for the table
$comment The comment on the table
$tablespace The new tablespace for the table ('' means leave as is)
Результат -7

_alterView() защищенный Метод

Protected method which alter a view SHOULDN'T BE CALLED OUTSIDE OF A TRANSACTION
protected _alterView ( $vwrs, $name, $owner, $schema, $comment ) : -6
$vwrs The view recordSet returned by getView()
$name The new name for the view
$owner The new owner for the view
$comment The comment on the view
Результат -6

_encryptPassword() публичный Метод

Helper function that computes encypted PostgreSQL passwords
public _encryptPassword ( $username, $password )
$username The username
$password The password

_parseACL() публичный Метод

Internal function used for parsing ACLs
public _parseACL ( $acl ) : Privileges
$acl The ACL to parse (of type aclitem[])
Результат Privileges array

addCheckConstraint() публичный Метод

Adds a check constraint to a table
public addCheckConstraint ( $table, $definition, $name = '' )
$table The table to which to add the check
$definition The definition of the check
$name (optional) The name to give the check, otherwise default name is assigned

addColumn() публичный Метод

Add a new column to a table
public addColumn ( $table, $column, $type, $array, $length, $notnull, $default, $comment )
$table The table to add to
$column The name of the new column
$type The type of the column
$array True if array type, false otherwise
$length The optional size of the column (ie. 30 for varchar(30))
$notnull True if NOT NULL, false otherwise
$default The default for the column. '' for none.

addDomainCheckConstraint() публичный Метод

Adds a check constraint to a domain
public addDomainCheckConstraint ( $domain, $definition, $name = '' )
$domain The domain to which to add the check
$definition The definition of the check
$name (optional) The name to give the check, otherwise default name is assigned

addForeignKey() публичный Метод

Adds a foreign key constraint to a table
public addForeignKey ( $table, $targschema, $targtable, $sfields, $tfields, $upd_action, $del_action, $match, $deferrable, $initially, $name = '' ) : -1
$targschema The schema that houses the target table to which to add the foreign key
$targtable The table to which to add the foreign key
$sfields (array) An array of source fields over which to add the foreign key
$tfields (array) An array of target fields over which to add the foreign key
$upd_action The action for updates (eg. RESTRICT)
$del_action The action for deletes (eg. RESTRICT)
$match The match type (eg. MATCH FULL)
$deferrable The deferrability (eg. NOT DEFERRABLE)
$name (optional) The name to give the key, otherwise default name is assigned
Результат -1

addGroupMember() публичный Метод

Adds a group member
public addGroupMember ( $groname, $user )
$groname The name of the group
$user The name of the user to add to the group

addPrimaryKey() публичный Метод

Adds a primary key constraint to a table
public addPrimaryKey ( $table, $fields, $name = '', $tablespace = '' ) : -1
$table The table to which to add the primery key
$fields (array) An array of fields over which to add the primary key
$name (optional) The name to give the key, otherwise default name is assigned
$tablespace (optional) The tablespace for the schema, '' indicates default.
Результат -1

addUniqueKey() публичный Метод

Adds a unique constraint to a table
public addUniqueKey ( $table, $fields, $name = '', $tablespace = '' ) : -1
$table The table to which to add the unique key
$fields (array) An array of fields over which to add the unique key
$name (optional) The name to give the key, otherwise default name is assigned
$tablespace (optional) The tablespace for the schema, '' indicates default.
Результат -1

alreadyClustered() публичный Метод

test if a table has been clustered on an index
public alreadyClustered ( $table ) : true
$table The table to test
Результат true if the table has been already clustered

alterAggregate() публичный Метод

Alters an aggregate
public alterAggregate ( $aggrname, $aggrtype, $aggrowner, $aggrschema, $aggrcomment, $newaggrname, $newaggrowner, $newaggrschema, $newaggrcomment ) : -4
$aggrname The actual name of the aggregate
$aggrtype The actual input data type of the aggregate
$aggrowner The actual owner of the aggregate
$aggrschema The actual schema the aggregate belongs to
$aggrcomment The actual comment for the aggregate
$newaggrname The new name of the aggregate
$newaggrowner The new owner of the aggregate
$newaggrschema The new schema where the aggregate will belong to
$newaggrcomment The new comment for the aggregate
Результат -4

alterColumn() публичный Метод

Alters a column in a table
public alterColumn ( $table, $column, $name, $notnull, $oldnotnull, $default, $olddefault, $type, $length, $array, $oldtype, $comment ) : -6
$table The table in which the column resides
$column The column to alter
$name The new name for the column
$notnull (boolean) True if not null, false otherwise
$oldnotnull (boolean) True if column is already not null, false otherwise
$default The new default for the column
$olddefault The old default for the column
$type The new type for the column
$length The optional size of the column (ie. 30 for varchar(30))
$array True if array type, false otherwise
$oldtype The old type for the column
$comment Comment for the column
Результат -6

alterDatabase() публичный Метод

Alters a database the multiple return vals are for postgres 8+ which support more functionality in alter database
public alterDatabase ( $dbName, $newName, $newOwner = '', $comment = '' ) : -4
$dbName The name of the database
$newName new name for the database
$newOwner The new owner for the database
Результат -4

alterDatabaseOwner() публичный Метод

Changes ownership of a database This can only be done by a superuser or the owner of the database
public alterDatabaseOwner ( string $dbName, string $newOwner ) : integer
$dbName string database to change ownership of
$newOwner string user that will own the database
Результат integer 0 on success

alterDatabaseRename() публичный Метод

Renames a database, note that this operation cannot be performed on a database that is currently being connected to
public alterDatabaseRename ( string $oldName, string $newName ) : integer
$oldName string name of database to rename
$newName string new name of database
Результат integer 0 on success

alterDomain() публичный Метод

Alters a domain
public alterDomain ( $domain, $domdefault, $domnotnull, $domowner ) : -4
$domain The domain to alter
$domdefault The domain default
$domnotnull True for NOT NULL, false otherwise
$domowner The domain owner
Результат -4

alterSequence() публичный Метод

Alters a sequence
public alterSequence ( $sequence, $name, $comment, $owner = null, $schema = null, $increment = null, $minvalue = null, $maxvalue = null, $restartvalue = null, $cachevalue = null, $cycledvalue = null, $startvalue = null ) : -2
$sequence The name of the sequence
$name The new name for the sequence
$comment The comment on the sequence
$owner The new owner for the sequence
$schema The new schema for the sequence
$increment The increment
$minvalue The min value
$maxvalue The max value
$restartvalue The starting value
$cachevalue The cache value
$cycledvalue True if cycled, false otherwise
$startvalue The sequence start value when issueing a restart
Результат -2

alterSequenceName() публичный Метод

Rename a sequence
public alterSequenceName ( $seqrs, $name )
$seqrs The sequence RecordSet returned by getSequence()
$name The new name for the sequence

alterSequenceOwner() публичный Метод

Alter a sequence's owner
public alterSequenceOwner ( $seqrs, $owner )
$seqrs The sequence RecordSet returned by getSequence()

alterSequenceProps() публичный Метод

Alter a sequence's properties
public alterSequenceProps ( $seqrs, $increment, $minvalue, $maxvalue, $restartvalue, $cachevalue, $cycledvalue, $startvalue )
$seqrs The sequence RecordSet returned by getSequence()
$increment The sequence incremental value
$minvalue The sequence minimum value
$maxvalue The sequence maximum value
$restartvalue The sequence current value
$cachevalue The sequence cache value
$cycledvalue Sequence can cycle ?
$startvalue The sequence start value when issueing a restart

alterSequenceSchema() публичный Метод

Alter a sequence's schema
public alterSequenceSchema ( $seqrs, $schema )
$seqrs The sequence RecordSet returned by getSequence()

alterTable() публичный Метод

Alter table properties
public alterTable ( $table, $name, $owner, $schema, $comment, $tablespace ) : -2
$table The name of the table
$name The new name for the table
$owner The new owner for the table
$schema The new schema for the table
$comment The comment on the table
$tablespace The new tablespace for the table ('' means leave as is)
Результат -2

alterTableName() публичный Метод

Alter a table's name !\ this function is called from _alterTable which take care of escaping fields
public alterTableName ( $tblrs, $name = null )
$tblrs The table RecordSet returned by getTable()
$name The new table's name

alterTableOwner() публичный Метод

Alter a table's owner !\ this function is called from _alterTable which take care of escaping fields
public alterTableOwner ( $tblrs, $owner = null )
$tblrs The table RecordSet returned by getTable()

alterTableSchema() публичный Метод

Alter a table's schema !\ this function is called from _alterTable which take care of escaping fields
public alterTableSchema ( $tblrs, $schema = null )
$tblrs The table RecordSet returned by getTable()

alterTableTablespace() публичный Метод

Alter a table's tablespace !\ this function is called from _alterTable which take care of escaping fields
public alterTableTablespace ( $tblrs, $tablespace = null )
$tblrs The table RecordSet returned by getTable()

alterTablespace() публичный Метод

Alters a tablespace
public alterTablespace ( $spcname, $name, $owner, $comment = '' ) : -4
$spcname The name of the tablespace
$name The new name for the tablespace
$owner The new owner for the tablespace
Результат -4

alterTrigger() публичный Метод

Alters a trigger
public alterTrigger ( $table, $trigger, $name )
$table The name of the table containing the trigger
$trigger The name of the trigger to alter
$name The new name for the trigger

alterView() публичный Метод

Alter view properties
public alterView ( $view, $name, $owner, $schema, $comment ) : -2
$view The name of the view
$name The new name for the view
$owner The new owner for the view
$schema The new schema for the view
$comment The comment on the view
Результат -2

alterViewName() публичный Метод

Rename a view
public alterViewName ( $vwrs, $name )
$vwrs The view recordSet returned by getView()
$name The new view's name

alterViewOwner() публичный Метод

Alter a view's owner
public alterViewOwner ( $vwrs, $owner = null )
$vwrs The view recordSet returned by getView()

alterViewSchema() публичный Метод

Alter a view's schema
public alterViewSchema ( $vwrs, $schema )
$vwrs The view recordSet returned by getView()

analyzeDB() публичный Метод

Analyze a database
public analyzeDB ( $table = '' )
$table (optional) The table to analyze

arrayClean() публичный Метод

Cleans (escapes) an array
public arrayClean ( &$arr ) : The
$arr The array to clean, by reference
Результат The cleaned array

beginDump() публичный Метод

Sets up the data object for a dump. eg. Starts the appropriate transaction, sets variables, etc.
public beginDump ( )

browseQuery() публичный Метод

Returns a recordset of all columns in a query. Supports paging.
public browseQuery ( $type, $table, $query, $sortkey, $sortdir, $page, $page_size, &$max_pages ) : -5
$type Either 'QUERY' if it is an SQL query, or 'TABLE' if it is a table identifier, or 'SELECT" if it's a select query
$table The base table of the query. NULL for no table.
$query The query that is being executed. NULL for no query.
$sortkey The column number to sort by, or '' or null for no sorting
$sortdir The direction in which to sort the specified column ('asc' or 'desc')
$page The page of the relation to retrieve
$page_size The number of rows per page
Результат -5 recordset on success

browseQueryCount() публичный Метод

Finds the number of rows that would be returned by a query.
public browseQueryCount ( $query, $count ) : -1
$query The SQL query
$count The count query
Результат -1 count of rows

browseRow() публичный Метод

Returns a recordset of all columns in a table
public browseRow ( $table, $key ) : A
$table The name of a table
$key The associative array holding the key to retrieve
Результат A recordset

changeAggregateOwner() публичный Метод

Changes the owner of an aggregate function
public changeAggregateOwner ( $aggrname, $aggrtype, $newaggrowner )
$aggrname The name of the aggregate
$aggrtype The input data type of the aggregate
$newaggrowner The new owner of the aggregate

changeAggregateSchema() публичный Метод

Changes the schema of an aggregate function
public changeAggregateSchema ( $aggrname, $aggrtype, $newaggrschema )
$aggrname The name of the aggregate
$aggrtype The input data type of the aggregate
$newaggrschema The new schema for the aggregate

changeFtsMapping() публичный Метод

Creates/updates/deletes FTS mapping.
public changeFtsMapping ( $ftscfg, array $mapping, string $action, string $dictname = null )
$mapping array Array of tokens' names
$action string What to do with the mapping: add, alter or drop
$dictname string Dictionary that will process tokens given or null in case of drop action

changePassword() публичный Метод

Changes a role's password
public changePassword ( $rolename, $password )
$rolename The role name
$password The new password

clean() публичный Метод

Cleans (escapes) a string
public clean ( &$str ) : The
$str The string to clean, by reference
Результат The cleaned string

clusterIndex() публичный Метод

Clusters an index
public clusterIndex ( $table = '', $index = '' )
$table The table the index is on
$index The name of the index

createAggregate() публичный Метод

Creates a new aggregate in the database
public createAggregate ( $name, $basetype, $sfunc, $stype, $ffunc, $initcond, $sortop, $comment ) : -1
$name The name of the aggregate
$basetype The input data type of the aggregate
$sfunc The name of the state transition function for the aggregate
$stype The data type for the aggregate's state value
$ffunc The name of the final function for the aggregate
$initcond The initial setting for the state value
$sortop The sort operator for the aggregate
$comment Aggregate comment
Результат -1

createCompositeType() публичный Метод

Creates a new composite type in the database
public createCompositeType ( $name, $fields, $field, $type, $array, $length, $colcomment, $typcomment ) : -1
$name The name of the type
$fields The number of fields
$field An array of field names
$type An array of field types
$array An array of '' or '[]' for each type if it's an array or not
$length An array of field lengths
$colcomment An array of comments
$typcomment Type comment
Результат -1

createDatabase() публичный Метод

Creates a database
public createDatabase ( $database, $encoding, $tablespace = '', $comment = '', $template = 'template1', $lc_collate = '', $lc_ctype = '' ) : -2
$database The name of the database to create
$encoding Encoding of the database
$tablespace (optional) The tablespace name
Результат -2

createDomain() публичный Метод

Creates a domain
public createDomain ( $domain, $type, $length, $array, $notnull, $default, $check )
$domain The name of the domain to create
$type The base type for the domain
$length Optional type length
$array True for array type, false otherwise
$notnull True for NOT NULL, false otherwise
$default Default value for domain
$check A CHECK constraint if there is one

createEnumType() публичный Метод

Creates a new enum type in the database
public createEnumType ( $name, $values, $typcomment ) : -2
$name The name of the type
$values An array of values
$typcomment Type comment
Результат -2

createFtsConfiguration() публичный Метод

Creates a new FTS configuration.
public createFtsConfiguration ( string $cfgname, string $parser = '', string $template = '', string $comment = '' )
$cfgname string The name of the FTS configuration to create
$parser string The parser to be used in new FTS configuration
$template string The existing FTS configuration to be used as template for the new one
$comment string If omitted, defaults to nothing

createFtsDictionary() публичный Метод

Creates a new FTS dictionary or FTS dictionary template.
public createFtsDictionary ( string $dictname, boolean $isTemplate = false, string $template = '', string $lexize = '', string $init = '', string $option = '', string $comment = '' )
$dictname string The name of the FTS dictionary to create
$isTemplate boolean Flag whether we create usual dictionary or dictionary template
$template string The existing FTS dictionary to be used as template for the new one
$lexize string The name of the function, which does transformation of input word
$init string The name of the function, which initializes dictionary
$option string Usually, it stores various options required for the dictionary
$comment string If omitted, defaults to nothing

createFunction() публичный Метод

Creates a new function.
public createFunction ( $funcname, $args, $returns, $definition, $language, $flags, $setof, $cost, $rows, $comment, $replace = false ) : -4
$funcname The name of the function to create
$args A comma separated string of types
$returns The return type
$definition The definition for the new function
$language The language the function is written for
$flags An array of optional flags
$setof True if it returns a set, false otherwise
$cost cost the planner should use in the function execution step
$rows number of rows planner should estimate will be returned
$comment Comment for the function
$replace (optional) True if OR REPLACE, false for normal
Результат -4

createGroup() публичный Метод

Creates a new group
public createGroup ( $groname, $users )
$groname The name of the group
$users An array of users to add to the group

createIndex() публичный Метод

Creates an index
public createIndex ( $name, $table, $columns, $type, $unique, $where, $tablespace, $concurrently )
$name The index name
$table The table on which to add the index
$columns An array of columns that form the index or a string expression for a functional index
$type The index type
$unique True if unique, false otherwise
$where Index predicate ('' for none)
$tablespace The tablespaces ('' means none/default)

createRole() публичный Метод

Creates a new role
public createRole ( $rolename, $password, $superuser, $createdb, $createrole, $inherits, $login, $connlimit, $expiry, $memberof, $members, $adminmembers )
$rolename The name of the role to create
$password A password for the role
$superuser Boolean whether or not the role is a superuser
$createdb Boolean whether or not the role can create databases
$createrole Boolean whether or not the role can create other roles
$inherits Boolean whether or not the role inherits the privileges from parent roles
$login Boolean whether or not the role will be allowed to login
$connlimit Number of concurrent connections the role can make
$expiry String Format 'YYYY-MM-DD HH:MM:SS'. '' means never expire
$memberof (array) Roles to which the new role will be immediately added as a new member
$members (array) Roles which are automatically added as members of the new role
$adminmembers (array) Roles which are automatically added as admin members of the new role

createRule() публичный Метод

Creates a rule
public createRule ( $name, $event, $table, $where, $instead, $type, $action, $replace = false ) : -1
$name The name of the new rule
$event SELECT, INSERT, UPDATE or DELETE
$table Table on which to create the rule
$where When to execute the rule, '' indicates always
$instead True if an INSTEAD rule, false otherwise
$type NOTHING for a do nothing rule, SOMETHING to use given action
$action The action to take
$replace (optional) True to replace existing rule, false otherwise
Результат -1

createSchema() публичный Метод

Creates a new schema.
public createSchema ( $schemaname, $authorization = '', $comment = '' )
$schemaname The name of the schema to create
$authorization (optional) The username to create the schema for.
$comment (optional) If omitted, defaults to nothing

createSequence() публичный Метод

Creates a new sequence
public createSequence ( $sequence, $increment, $minvalue, $maxvalue, $startvalue, $cachevalue, $cycledvalue )
$sequence Sequence name
$increment The increment
$minvalue The min value
$maxvalue The max value
$startvalue The starting value
$cachevalue The cache value
$cycledvalue True if cycled, false otherwise

createTable() публичный Метод

Creates a new table in the database
public createTable ( $name, $fields, $field, $type, $array, $length, $notnull, $default, $withoutoids, $colcomment, $tblcomment, $tablespace, $uniquekey, $primarykey ) : -1
$name The name of the table
$fields The number of fields
$field An array of field names
$type An array of field types
$array An array of '' or '[]' for each type if it's an array or not
$length An array of field lengths
$notnull An array of not null
$default An array of default values
$withoutoids True if WITHOUT OIDS, false otherwise
$colcomment An array of comments
$tablespace The tablespace name ('' means none/default)
$uniquekey An Array indicating the fields that are unique (those indexes that are set)
$primarykey An Array indicating the field used for the primarykey (those indexes that are set)
Результат -1

createTableLike() публичный Метод

Creates a new table in the database copying attribs and other properties from another table
public createTableLike ( $name, $like, $defaults = false, $constraints = false, $idx = false, $tablespace = '' )
$name The name of the table
$like an array giving the schema ans the name of the table from which attribs are copying from: array( 'table' => table name, 'schema' => the schema name, )
$defaults if true, copy the defaults values as well
$constraints if true, copy the constraints as well (CHECK on table & attr)
$tablespace The tablespace name ('' means none/default)

createTablespace() публичный Метод

Creates a tablespace
public createTablespace ( $spcname, $spcowner, $spcloc, $comment = '' )
$spcname The name of the tablespace to create
$spcowner The owner of the tablespace. '' for current
$spcloc The directory in which to create the tablespace

createTrigger() публичный Метод

Creates a trigger
public createTrigger ( $tgname, $table, $tgproc, $tgtime, $tgevent, $tgfrequency, $tgargs )
$tgname The name of the trigger to create
$table The name of the table
$tgproc The function to execute
$tgtime BEFORE or AFTER
$tgevent Event
$tgargs The function arguments

createType() публичный Метод

Creates a new type
public createType ( $typname, $typin, $typout, $typlen, $typdef, $typelem, $typdelim, $typbyval, $typalign, $typstorage )

createUser() публичный Метод

Creates a new user
public createUser ( $username, $password, $createdb, $createuser, $expiry, $groups )
$username The username of the user to create
$password A password for the user
$createdb boolean Whether or not the user can create databases
$createuser boolean Whether or not the user can create other users
$expiry string Format 'YYYY-MM-DD HH:MM:SS'. '' means never expire

createView() публичный Метод

Creates a new view.
public createView ( $viewname, $definition, $replace, $comment )
$viewname The name of the view to create
$definition The definition for the new view
$replace True to replace the view, false otherwise

dbBool() публичный Метод

Change the value of a parameter to 't' or 'f' depending on whether it evaluates to true or false
public dbBool ( &$parameter )
$parameter the parameter

deleteRow() публичный Метод

Delete a row from a table
public deleteRow ( $table, $key, $schema = false )
$table The table from which to delete
$key An array mapping column => value to delete

disableTrigger() публичный Метод

Disables a trigger
public disableTrigger ( $tgname, $table )
$tgname The name of the trigger to disable
$table The table in which to disable the trigger

dropAggregate() публичный Метод

Removes an aggregate function from the database
public dropAggregate ( $aggrname, $aggrtype, $cascade )
$aggrname The name of the aggregate
$aggrtype The input data type of the aggregate
$cascade True to cascade drop, false to restrict

dropAutovacuum() публичный Метод

public dropAutovacuum ( $table )

dropCheckConstraint() публичный Метод

Drops a check constraint from a table
public dropCheckConstraint ( $table, $name ) : -4
$table The table from which to drop the check
$name The name of the check to be dropped
Результат -4

dropColumn() публичный Метод

Drops a column from a table
public dropColumn ( $table, $column, $cascade )
$table The table from which to drop a column
$column The column to be dropped
$cascade True to cascade drop, false to restrict

dropColumnDefault() публичный Метод

Drops default value of a column
public dropColumnDefault ( $table, $column )
$table The table from which to drop
$column The column name to drop default

dropConstraint() публичный Метод

Removes a constraint from a relation
public dropConstraint ( $constraint, $relation, $type, $cascade )
$constraint The constraint to drop
$relation The relation from which to drop
$type The type of constraint (c, f, u or p)
$cascade True to cascade drop, false to restrict

dropDatabase() публичный Метод

Drops a database
public dropDatabase ( $database )
$database The name of the database to drop

dropDomain() публичный Метод

Drops a domain.
public dropDomain ( $domain, $cascade )
$domain The name of the domain to drop
$cascade True to cascade drop, false to restrict

dropDomainConstraint() публичный Метод

Drops a domain constraint
public dropDomainConstraint ( $domain, $constraint, $cascade )
$domain The domain from which to remove the constraint
$constraint The constraint to remove
$cascade True to cascade, false otherwise

dropFtsConfiguration() публичный Метод

Drops FTS coniguration
public dropFtsConfiguration ( $ftscfg, $cascade )
$ftscfg The configuration's name
$cascade Cascade to dependenced objects

dropFtsDictionary() публичный Метод

Drops FTS dictionary
public dropFtsDictionary ( $ftsdict, $cascade )
$ftsdict The dico's name
$cascade Cascade to dependenced objects

dropFunction() публичный Метод

Drops a function.
public dropFunction ( $function_oid, $cascade )
$function_oid The OID of the function to drop
$cascade True to cascade drop, false to restrict

dropGroup() публичный Метод

Removes a group
public dropGroup ( $groname )
$groname The name of the group to drop

dropGroupMember() публичный Метод

Removes a group member
public dropGroupMember ( $groname, $user )
$groname The name of the group
$user The name of the user to remove from the group

dropIndex() публичный Метод

Removes an index from the database
public dropIndex ( $index, $cascade )
$index The index to drop
$cascade True to cascade drop, false to restrict

dropOperator() публичный Метод

Drops an operator
public dropOperator ( $operator_oid, $cascade )
$operator_oid The OID of the operator to drop
$cascade True to cascade drop, false to restrict

dropRole() публичный Метод

Removes a role
public dropRole ( $rolename )
$rolename The name of the role to drop

dropRule() публичный Метод

Removes a rule from a table OR view
public dropRule ( $rule, $relation, $cascade )
$rule The rule to drop
$relation The relation from which to drop
$cascade True to cascade drop, false to restrict

dropSchema() публичный Метод

Drops a schema.
public dropSchema ( $schemaname, $cascade )
$schemaname The name of the schema to drop
$cascade True to cascade drop, false to restrict

dropSequence() публичный Метод

Drops a given sequence
public dropSequence ( $sequence, $cascade )
$sequence Sequence name
$cascade True to cascade drop, false to restrict

dropTable() публичный Метод

Removes a table from the database
public dropTable ( $table, $cascade )
$table The table to drop
$cascade True to cascade drop, false to restrict

dropTablespace() публичный Метод

Drops a tablespace
public dropTablespace ( $spcname )
$spcname The name of the domain to drop

dropTrigger() публичный Метод

Drops a trigger
public dropTrigger ( $tgname, $table, $cascade )
$tgname The name of the trigger to drop
$table The table from which to drop the trigger
$cascade True to cascade drop, false to restrict

dropType() публичный Метод

Drops a type.
public dropType ( $typname, $cascade )
$typname The name of the type to drop
$cascade True to cascade drop, false to restrict

dropUser() публичный Метод

Removes a user
public dropUser ( $username )
$username The username of the user to drop

dropView() публичный Метод

Drops a view.
public dropView ( $viewname, $cascade )
$viewname The name of the view to drop
$cascade True to cascade drop, false to restrict

dumpRelation() публичный Метод

@@ Note: Really needs to use a cursor
public dumpRelation ( $relation, $oids ) : -1
$relation The name of a relation
Результат -1 recordset on success

editRow() публичный Метод

Updates a row in a table
public editRow ( $table, $vars, $nulls, $format, $types, $keyarr ) : -1
$table The table in which to update
$vars An array mapping new values for the row
$nulls An array mapping column => something if it is to be null
$format An array of the data type (VALUE or EXPRESSION)
$types An array of field types
$keyarr An array mapping column => value to update
Результат -1

emptyTable() публичный Метод

Empties a table in the database
public emptyTable ( $table )
$table The table to be emptied

enableTrigger() публичный Метод

Enables a trigger
public enableTrigger ( $tgname, $table )
$tgname The name of the trigger to enable
$table The table in which to enable the trigger

endDump() публичный Метод

Ends the data object for a dump.
public endDump ( )

escapeBytea() публичный Метод

Escapes bytea data for display on the screen
public escapeBytea ( $data ) : Data
$data The bytea data
Результат Data formatted for on-screen display

executeScript() публичный Метод

XXX: It does not handle multibyte languages properly.
public executeScript ( $name, $callback = null ) : True
$name Entry in $_FILES to use
$callback (optional) Callback function to call with each query, its result and line number.
Результат True for general success, false on any failure.

fieldArrayClean() публичный Метод

Cleans (escapes) an array of field names
public fieldArrayClean ( &$arr ) : The
$arr The array to clean, by reference
Результат The cleaned array

fieldClean() публичный Метод

Cleans (escapes) an object name (eg. table, field)
public fieldClean ( &$str ) : The
$str The string to clean, by reference
Результат The cleaned string

findObject() публичный Метод

Searches all system catalogs to find objects that match a certain name.
public findObject ( $term, $filter ) : A
$term The search term
$filter The object type to restrict to ('' means no restriction)
Результат A recordset

formatType() публичный Метод

Formats a type correctly for display. Postgres 7.0 had no 'format_type' built-in function, and hence we need to do it manually.
public formatType ( $typname, $typmod )
$typname The name of the type
$typmod The contents of the typmod field

formatValue() публичный Метод

Formats a value or expression for sql purposes
public formatValue ( $type, $format, $value ) : The
$type The type of the field
$format VALUE or EXPRESSION
$value The actual value entered in the field. Can be NULL
Результат The suitably quoted and escaped value.

getAggregate() публичный Метод

Gets all information for an aggregate
public getAggregate ( $name, $basetype ) : A
$name The name of the aggregate
$basetype The input data type of the aggregate
Результат A recordset

getAggregates() публичный Метод

Gets all aggregates
public getAggregates ( ) : A
Результат A recordset

getAttributeNames() публичный Метод

Given an array of attnums and a relation, returns an array mapping attribute number to attribute name.
public getAttributeNames ( $table, $atts ) : -2
$table The table to get attributes for
$atts An array of attribute numbers
Результат -2 array mapping attnum to attname

getAutovacuum() публичный Метод

Returns all autovacuum global configuration
public getAutovacuum ( ) : associative
Результат associative array array( param => value, ...)

getCasts() публичный Метод

Returns a list of all casts in the database
public getCasts ( ) : All
Результат All casts

getChangeUserSQL() публичный Метод

Returns the SQL for changing the current user
public getChangeUserSQL ( $user ) : The
$user The user to change to
Результат The SQL

getConstraints() публичный Метод

Returns a list of all constraints on a table
public getConstraints ( $table ) : A
$table The table to find rules for
Результат A recordset

getConstraintsWithFields() публичный Метод

Returns a list of all constraints on a table, including constraint name, definition, related col and referenced namespace, table and col if needed
public getConstraintsWithFields ( $table ) : a
$table the table where we are looking for fk
Результат a recordset

getConversions() публичный Метод

Returns a list of all conversions in the database
public getConversions ( ) : All
Результат All conversions

getDatabase() публичный Метод

Return all information about a particular database
public getDatabase ( $database ) : The
$database The name of the database to retrieve
Результат The database info

getDatabaseComment() публичный Метод

Return the database comment of a db from the shared description table
public getDatabaseComment ( string $database ) : recordset
$database string the name of the database to get the comment for
Результат recordset of the db comment info

getDatabaseEncoding() публичный Метод

Returns the current database encoding
public getDatabaseEncoding ( ) : The
Результат The encoding. eg. SQL_ASCII, UTF-8, etc.

getDatabaseOwner() публичный Метод

Return the database owner of a db
public getDatabaseOwner ( string $database ) : recordset
$database string the name of the database to get the owner for
Результат recordset of the db owner info

getDatabases() публичный Метод

Return all database available on the server
public getDatabases ( $currentdatabase = NULL ) : A
$currentdatabase database name that should be on top of the resultset
Результат A list of databases, sorted alphabetically

getDefaultWithOid() публичный Метод

Returns the current default_with_oids setting
public getDefaultWithOid ( ) : default_with_oids
Результат default_with_oids setting

getDomain() публичный Метод

Gets all information for a single domain
public getDomain ( $domain ) : A
$domain The name of the domain to fetch
Результат A recordset

getDomainConstraints() публичный Метод

Get domain constraints
public getDomainConstraints ( $domain ) : A
$domain The name of the domain whose constraints to fetch
Результат A recordset

getDomains() публичный Метод

Return all domains in current schema. Excludes domain constraints.
public getDomains ( ) : All
Результат All tables, sorted alphabetically

getEnumValues() публичный Метод

Get defined values for a given enum
public getEnumValues ( $name ) : A
Результат A recordset

getFtsConfigurationByName() публичный Метод

Return all information related to a FTS configuration
public getFtsConfigurationByName ( $ftscfg ) : FTS
$ftscfg The name of the FTS configuration
Результат FTS configuration information

getFtsConfigurationMap() публичный Метод

Returns the map of FTS configuration given (list of mappings (tokens) and their processing dictionaries)
public getFtsConfigurationMap ( string $ftscfg ) : RecordSet
$ftscfg string Name of the FTS configuration
Результат RecordSet

getFtsConfigurations() публичный Метод

Returns available FTS configurations
public getFtsConfigurations ( $all = true ) : A
$all if false, returns schema qualified FTS confs
Результат A recordset

getFtsDictionaries() публичный Метод

Returns FTS dictionaries available
public getFtsDictionaries ( $all = true )
$all if false, return only Dics from the current schema

getFtsDictionaryByName() публичный Метод

Return all information relating to a FTS dictionary
public getFtsDictionaryByName ( $ftsdict ) : RecordSet
$ftsdict The name of the FTS dictionary
Результат RecordSet of FTS dictionary information

getFtsDictionaryTemplates() публичный Метод

Returns all FTS dictionary templates available

getFtsMappingByName() публичный Метод

Return all information related to a given FTS configuration's mapping
public getFtsMappingByName ( $ftscfg, $mapping ) : FTS
$ftscfg The name of the FTS configuration
$mapping The name of the mapping
Результат FTS configuration information

getFtsMappings() публичный Метод

Return list of FTS mappings possible for given parser (specified by given configuration since configuration can only have 1 parser)
public getFtsMappings ( $ftscfg )
$ftscfg The config's name that use the parser

getFtsParsers() публичный Метод

Returns FTS parsers available
public getFtsParsers ( $all = true ) : RecordSet
$all if false, return only Parsers from the current schema
Результат RecordSet

getFunction() публичный Метод

Returns all details for a particular function
public getFunction ( $function_oid ) : Function
Результат Function info

getFunctionProperties() публичный Метод

Returns an array containing a function's properties
public getFunctionProperties ( $f ) : An
$f The array of data for the function
Результат An array containing the properties

getFunctions() публичный Метод

Returns a list of all functions in the database
public getFunctions ( $all = false, $type = null ) : All
$all If true, will find all available functions, if false just those in search path
$type If not null, will find all functions with return value = type
Результат All functions

getGroup() публичный Метод

Return users in a specific group
public getGroup ( $groname ) : All
$groname The name of the group
Результат All users in the group

getGroups() публичный Метод

Returns all groups in the database cluser
public getGroups ( ) : All
Результат All groups

getHelp() публичный Метод

Fetch a URL (or array of URLs) for a given help page.
public getHelp ( $help )

getHelpPages() публичный Метод

public getHelpPages ( )

getIndexes() публичный Метод

Grabs a list of indexes for a table
public getIndexes ( $table = '', $unique = false ) : A
$table The name of a table whose indexes to retrieve
$unique Only get unique/pk indexes
Результат A recordset

getLanguages() публичный Метод

Gets all languages
public getLanguages ( $all = false ) : A
$all True to get all languages, regardless of show_system
Результат A recordset

getLinkingKeys() публичный Метод

A function for getting all columns linked by foreign keys given a group of tables
public getLinkingKeys ( $tables ) : -1
$tables multi dimensional assoc array that holds schema and table name
Результат -1 recordset of linked tables and columns

getLocks() публичный Метод

Returns table locks information in the current database
public getLocks ( ) : A
Результат A recordset

getMemberOf() публичный Метод

Returns all role names which the role belongs to
public getMemberOf ( $rolename ) : All
$rolename The role name
Результат All role names

getMembers() публичный Метод

Returns all role names that are members of a role
public getMembers ( $rolename, $admin = 'f' ) : All
$rolename The role name
$admin (optional) Find only admin members
Результат All role names

getOpClasses() публичный Метод

Gets all opclasses
public getOpClasses ( ) : A
Результат A recordset

getOperator() публичный Метод

Returns all details for a particular operator
public getOperator ( $operator_oid ) : Function
$operator_oid The oid of the operator
Результат Function info

getOperators() публичный Метод

Returns a list of all operators in the database
public getOperators ( ) : All
Результат All operators

getPreparedXacts() публичный Метод

Returns prepared transactions information
public getPreparedXacts ( $database = null ) : A
$database (optional) Find only prepared transactions executed in a specific database
Результат A recordset

getPrivileges() публичный Метод

Grabs an array of users and their privileges for an object, given its type.
public getPrivileges ( $object, $type, $table = null ) : -3
$object The name of the object whose privileges are to be retrieved
$type The type of the object (eg. database, schema, relation, function or language)
$table Optional, column's table if type = column
Результат -3 array

getProcesses() публичный Метод

Returns all available process information.
public getProcesses ( $database = null ) : A
$database (optional) Find only connections to specified database
Результат A recordset

getReferrers() публичный Метод

Finds the foreign keys that refer to the specified table
public getReferrers ( $table ) : A
$table The table to find referrers for
Результат A recordset

getRole() публичный Метод

Returns information about a single role
public getRole ( $rolename ) : The
$rolename The name of the role to retrieve
Результат The role's data

getRoles() публичный Метод

Returns all roles in the database cluster
public getRoles ( $rolename = '' ) : All
$rolename (optional) The role name to exclude from the select
Результат All roles

getRowIdentifier() публичный Метод

Get the fields for uniquely identifying a row in a table
public getRowIdentifier ( $table ) : -1
$table The table for which to retrieve the identifier
Результат -1 array mapping attribute number to attribute name, empty for no identifiers

getRules() публичный Метод

Returns a list of all rules on a table OR view
public getRules ( $table ) : A
$table The table to find rules for
Результат A recordset

getSchemaByName() публичный Метод

Return all information relating to a schema
public getSchemaByName ( $schema ) : Schema
$schema The name of the schema
Результат Schema information

getSchemas() публичный Метод

Return all schemas in the current database.
public getSchemas ( ) : All
Результат All schemas, sorted alphabetically

getSearchPath() публичный Метод

Return the current schema search path
public getSearchPath ( ) : Array
Результат Array of schema names

getSelectSQL() публичный Метод

Generates the SQL for the 'select' function
public getSelectSQL ( $table, $show, $values, $ops, $orderby = [] ) : The
$table The table from which to select
$show An array of columns to show. Empty array means all columns.
$values An array mapping columns to values
$ops An array of the operators to use
$orderby (optional) An array of column numbers or names (one based) mapped to sort direction (asc or desc or '' or null) to order by
Результат The SQL query

getSequence() публичный Метод

Returns properties of a single sequence
public getSequence ( $sequence ) : A
$sequence Sequence name
Результат A recordset

getSequences() публичный Метод

Returns all sequences in the current database
public getSequences ( $all = false ) : A
Результат A recordset

getStatsDatabase() публичный Метод

Fetches statistics for a database
public getStatsDatabase ( $database ) : A
$database The database to fetch stats for
Результат A recordset

getStatsIndexIO() публичный Метод

Fetches I/0 statistics for all indexes on a table
public getStatsIndexIO ( $table ) : A
$table The table to fetch index stats for
Результат A recordset

getStatsIndexTuples() публичный Метод

Fetches tuple statistics for all indexes on a table
public getStatsIndexTuples ( $table ) : A
$table The table to fetch index stats for
Результат A recordset

getStatsTableIO() публичный Метод

Fetches I/0 statistics for a table
public getStatsTableIO ( $table ) : A
$table The table to fetch stats for
Результат A recordset

getStatsTableTuples() публичный Метод

Fetches tuple statistics for a table
public getStatsTableTuples ( $table ) : A
$table The table to fetch stats for
Результат A recordset

getTable() публичный Метод

Returns table information
public getTable ( $table ) : A
$table The name of the table
Результат A recordset

getTableAttributes() публичный Метод

Retrieve the attribute definition of a table
public getTableAttributes ( $table, $field = '' ) : All
$table The name of the table
$field (optional) The name of a field to return
Результат All attributes in order

getTableAutovacuum() публичный Метод

Returns all available autovacuum per table information.
public getTableAutovacuum ( $table = '' ) : A
$table if given, return autovacuum info for the given table or return all informations for all table
Результат A recordset

getTableChildren() публичный Метод

Finds the names and schemas of child tables
public getTableChildren ( $table ) : A
$table The table to find the children for
Результат A recordset

getTableDefPrefix() публичный Метод

Returns the SQL definition for the table.
public getTableDefPrefix ( $table, $clean = false ) : null
$table The table to define
$clean True to issue drop command, false otherwise
Результат null string containing the formatted SQL code

getTableDefSuffix() публичный Метод

Returns extra table definition information that is most usefully dumped after the table contents for speed and efficiency reasons
public getTableDefSuffix ( $table ) : null
$table The table to define
Результат null string containing the formatted SQL code

getTableParents() публичный Метод

Finds the names and schemas of parent tables (in order)
public getTableParents ( $table ) : A
$table The table to find the parents for
Результат A recordset

getTables() публичный Метод

Return all tables in current database (and schema)
public getTables ( $all = false ) : All
$all True to fetch all tables, false for just in current schema
Результат All tables, sorted alphabetically

getTablespace() публичный Метод

Retrieves a tablespace's information
public getTablespace ( $spcname ) : A
Результат A recordset

getTablespaces() публичный Метод

Retrieves information for all tablespaces
public getTablespaces ( $all = false ) : A
$all Include all tablespaces (necessary when moving objects back to the default space)
Результат A recordset

getTrigger() публичный Метод

Grabs a single trigger
public getTrigger ( $table, $trigger ) : A
$table The name of a table whose triggers to retrieve
$trigger The name of the trigger to retrieve
Результат A recordset

getTriggerDef() публичный Метод

Note: Only needed for pre-7.4 servers, this function is deprecated
public getTriggerDef ( $trigger ) : The
$trigger An array containing fields from the trigger table
Результат The trigger definition string

getTriggerFunctions() публичный Метод

Returns a list of all functions that can be used in triggers
public getTriggerFunctions ( )

getTriggers() публичный Метод

Grabs a list of triggers on a table
public getTriggers ( $table = '' ) : A
$table The name of a table whose triggers to retrieve
Результат A recordset

getType() публичный Метод

Returns all details for a particular type
public getType ( $typname ) : Type
$typname The name of the view to retrieve
Результат Type info

getTypes() публичный Метод

Returns a list of all types in the database
public getTypes ( $all = false, $tabletypes = false, $domains = false ) : A
$all If true, will find all available types, if false just those in search path
$tabletypes If true, will include table types
$domains If true, will include domains
Результат A recordet

getUser() публичный Метод

Returns information about a single user
public getUser ( $username ) : The
$username The username of the user to retrieve
Результат The user's data

getUsers() публичный Метод

Returns all users in the database cluster
public getUsers ( ) : All
Результат All users

getVariables() публичный Метод

Returns all available variable information.
public getVariables ( ) : A
Результат A recordset

getView() публичный Метод

Returns all details for a particular view
public getView ( $view ) : View
$view The name of the view to retrieve
Результат View info

getViews() публичный Метод

Returns a list of all views in the database
public getViews ( ) : All
Результат All views

grantRole() публичный Метод

Grants membership in a role
public grantRole ( $role, $rolename, $admin )
$role The name of the target role
$rolename The name of the role that will belong to the target role
$admin (optional) Flag to grant the admin option

hasAggregateSortOp() публичный Метод

Capabilities
public hasAggregateSortOp ( )

hasAlterAggregate() публичный Метод

public hasAlterAggregate ( )

hasAlterColumnType() публичный Метод

public hasAlterColumnType ( )

hasAlterDatabase() публичный Метод

public hasAlterDatabase ( )

hasAlterDatabaseOwner() публичный Метод

hasAlterDatabaseRename() публичный Метод

hasAlterDomains() публичный Метод

public hasAlterDomains ( )

hasAlterSchema() публичный Метод

public hasAlterSchema ( )

hasAlterSchemaOwner() публичный Метод

public hasAlterSchemaOwner ( )

hasAlterSequenceSchema() публичный Метод

hasAlterSequenceStart() публичный Метод

hasAlterTableSchema() публичный Метод

public hasAlterTableSchema ( )

hasAutovacuum() публичный Метод

public hasAutovacuum ( )

hasByteaHexDefault() публичный Метод

public hasByteaHexDefault ( )

hasConcurrentIndexBuild() публичный Метод

hasCreateFieldWithConstraints() публичный Метод

hasCreateTableLike() публичный Метод

public hasCreateTableLike ( )

hasCreateTableLikeWithConstraints() публичный Метод

hasCreateTableLikeWithIndexes() публичный Метод

hasDatabaseCollation() публичный Метод

hasDisableTriggers() публичный Метод

public hasDisableTriggers ( )

hasDomainConstraints() публичный Метод

hasEnumTypes() публичный Метод

public hasEnumTypes ( )

hasFTS() публичный Метод

public hasFTS ( )

hasForceReindex() публичный Метод

public hasForceReindex ( )

hasFunctionAlterOwner() публичный Метод

hasFunctionAlterSchema() публичный Метод

hasFunctionCosting() публичный Метод

public hasFunctionCosting ( )

hasFunctionGUC() публичный Метод

public hasFunctionGUC ( )

hasGrantOption() публичный Метод

public hasGrantOption ( )

hasMagicTypes() публичный Метод

public hasMagicTypes ( )

hasNamedParams() публичный Метод

public hasNamedParams ( )

hasObjectID() публичный Метод

Checks to see whether or not a table has a unique id column
public hasObjectID ( $table ) : null
$table The table name
Результат null if it has a unique id, false otherwise

hasPrepare() публичный Метод

public hasPrepare ( )

hasPreparedXacts() публичный Метод

public hasPreparedXacts ( )

hasQueryCancel() публичный Метод

public hasQueryCancel ( )

hasQueryKill() публичный Метод

public hasQueryKill ( )

hasReadOnlyQueries() публичный Метод

public hasReadOnlyQueries ( )

hasRecluster() публичный Метод

public hasRecluster ( )

hasRoles() публичный Метод

public hasRoles ( )

hasServerAdminFuncs() публичный Метод

public hasServerAdminFuncs ( )

hasSharedComments() публичный Метод

public hasSharedComments ( )

hasTablespaces() публичный Метод

public hasTablespaces ( )

hasUserRename() публичный Метод

public hasUserRename ( )

hasUserSignals() публичный Метод

public hasUserSignals ( )

hasVirtualTransactionId() публичный Метод

insertRow() публичный Метод

Adds a new row to a table
public insertRow ( $table, $fields, $values, $nulls, $format, $types ) : -1
$table The table in which to insert
$fields Array of given field in values
$values Array of new values for the row
$nulls An array mapping column => something if it is to be null
$format An array of the data type (VALUE or EXPRESSION)
$types An array of field types
Результат -1

isSuperUser() публичный Метод

Determines whether or not a user is a super user
public isSuperUser ( $username = '' ) : True
$username The username of the user
Результат True if is a super user, false otherwise

nextvalSequence() публичный Метод

Execute nextval on a given sequence
public nextvalSequence ( $sequence ) : -1
$sequence Sequence name
Результат -1

phpBool() публичный Метод

Change a parameter from 't' or 'f' to a boolean, (others evaluate to false)
public phpBool ( $parameter )
$parameter the parameter

printField() публичный Метод

Outputs the HTML code for a particular field
public printField ( $name, $value, $type, $extras = [] )
$name The name to give the field
$value The value of the field. Note this could be 'numeric(7,2)' sort of thing...
$type The database type of the field
$extras An array of attributes name as key and attributes' values as value

reindex() публичный Метод

Rebuild indexes
public reindex ( $type, $name, $force = false )
$type 'DATABASE' or 'TABLE' or 'INDEX'
$name The name of the specific database, table, or index to be reindexed
$force If true, recreates indexes forcedly in PostgreSQL 7.0-7.1, forces rebuild of system indexes in 7.2-7.3, ignored in >=7.4

renameAggregate() публичный Метод

Renames an aggregate function
public renameAggregate ( $aggrschema, $aggrname, $aggrtype, $newaggrname )
$aggrname The actual name of the aggregate
$aggrtype The actual input data type of the aggregate
$newaggrname The new name of the aggregate

renameColumn() публичный Метод

Renames a column in a table
public renameColumn ( $table, $column, $newName )
$table The table containing the column to be renamed
$column The column to be renamed
$newName The new name for the column

renameRole() публичный Метод

Renames a role
public renameRole ( $rolename, $newrolename )
$rolename The name of the role to rename
$newrolename The new name of the role

renameUser() публичный Метод

Renames a user
public renameUser ( $username, $newname )
$username The username of the user to rename
$newname The new name of the user

resetSequence() публичный Метод

Resets a given sequence to min value of sequence
public resetSequence ( $sequence ) : -1
$sequence Sequence name
Результат -1

restartSequence() публичный Метод

Restart a given sequence to its start value
public restartSequence ( $sequence ) : -1
$sequence Sequence name
Результат -1

revokeRole() публичный Метод

Revokes membership in a role
public revokeRole ( $role, $rolename, $admin, $type = 'RESTRICT' )
$role The name of the target role
$rolename The name of the role that will not belong to the target role
$admin (optional) Flag to revoke only the admin option
$type (optional) Type of revoke: RESTRICT | CASCADE

saveAutovacuum() публичный Метод

Returns all available autovacuum per table information.
public saveAutovacuum ( $table, $vacenabled, $vacthreshold, $vacscalefactor, $anathresold, $anascalefactor, $vaccostdelay, $vaccostlimit ) : A
Результат A recordset

sendSignal() публичный Метод

Sends a cancel or kill command to a process
public sendSignal ( $pid, $signal ) : -1
$pid The ID of the backend process
$signal 'CANCEL'
Результат -1

setColumnDefault() публичный Метод

Sets default value of a column
public setColumnDefault ( $table, $column, $default )
$table The table from which to drop
$column The column name to set
$default The new default value

setColumnNull() публичный Метод

Sets whether or not a column can contain NULLs
public setColumnNull ( $table, $column, $state )
$table The table that contains the column
$column The column to alter
$state True to set null, false to set not null

setComment() публичный Метод

Sets the comment for an object in the database
public setComment ( $obj_type, $obj_name, $table, $comment, $basetype = NULL )
$obj_type One of 'TABLE' | 'COLUMN' | 'VIEW' | 'SCHEMA' | 'SEQUENCE' | 'TYPE' | 'FUNCTION' | 'AGGREGATE'
$obj_name The name of the object for which to attach a comment.
$table Name of table that $obj_name belongs to. Ignored unless $obj_type is 'TABLE' or 'COLUMN'.
$comment The comment to add.

setFunction() публичный Метод

Updates (replaces) a function.
public setFunction ( $function_oid, $funcname, $newname, $args, $returns, $definition, $language, $flags, $setof, $funcown, $newown, $funcschema, $newschema, $cost, $rows, $comment ) : -7
$function_oid The OID of the function
$funcname The name of the function to create
$newname The new name for the function
$args The array of argument types
$returns The return type
$definition The definition for the new function
$language The language the function is written for
$flags An array of optional flags
$setof True if returns a set, false otherwise
$comment The comment on the function
Результат -7

setPrivileges() публичный Метод

Grants a privilege to a user, group or public
public setPrivileges ( $mode, $type, $object, $public, $usernames, $groupnames, $privileges, $grantoption, $cascade, $table ) : -4
$mode 'GRANT' or 'REVOKE';
$type The type of object
$object The name of the object
$public True to grant to public, false otherwise
$usernames The array of usernames to grant privs to.
$groupnames The array of group names to grant privs to.
$privileges The array of privileges to grant (eg. ('SELECT', 'ALL PRIVILEGES', etc.) )
$grantoption True if has grant option, false otherwise
$cascade True for cascade revoke, false otherwise
$table the column's table if type=column
Результат -4

setRenameRole() публичный Метод

Adjusts a role's info and renames it
public setRenameRole ( $rolename, $password, $superuser, $createdb, $createrole, $inherits, $login, $connlimit, $expiry, $memberof, $members, $adminmembers, $memberofold, $membersold, $adminmembersold, $newrolename ) : -3
$rolename The name of the role to adjust
$password A password for the role
$superuser Boolean whether or not the role is a superuser
$createdb Boolean whether or not the role can create databases
$createrole Boolean whether or not the role can create other roles
$inherits Boolean whether or not the role inherits the privileges from parent roles
$login Boolean whether or not the role will be allowed to login
$connlimit Number of concurrent connections the role can make
$expiry string Format 'YYYY-MM-DD HH:MM:SS'. '' means never expire
$memberof (array) Roles to which the role will be immediately added as a new member
$members (array) Roles which are automatically added as members of the role
$adminmembers (array) Roles which are automatically added as admin members of the role
$memberofold (array) Original roles whose the role belongs to
$membersold (array) Original roles that are members of the role
$adminmembersold (array) Original roles that are admin members of the role
$newrolename The new name of the role
Результат -3

setRenameUser() публичный Метод

Adjusts a user's info and renames the user
public setRenameUser ( $username, $password, $createdb, $createuser, $expiry, $newname ) : -3
$username The username of the user to modify
$password A new password for the user
$createdb boolean Whether or not the user can create databases
$createuser boolean Whether or not the user can create other users
$expiry string Format 'YYYY-MM-DD HH:MM:SS'. '' means never expire.
$newname The new name of the user
Результат -3

setRole() публичный Метод

Adjusts a role's info
public setRole ( $rolename, $password, $superuser, $createdb, $createrole, $inherits, $login, $connlimit, $expiry, $memberof, $members, $adminmembers, $memberofold, $membersold, $adminmembersold )
$rolename The name of the role to adjust
$password A password for the role
$superuser Boolean whether or not the role is a superuser
$createdb Boolean whether or not the role can create databases
$createrole Boolean whether or not the role can create other roles
$inherits Boolean whether or not the role inherits the privileges from parent roles
$login Boolean whether or not the role will be allowed to login
$connlimit Number of concurrent connections the role can make
$expiry string Format 'YYYY-MM-DD HH:MM:SS'. '' means never expire
$memberof (array) Roles to which the role will be immediately added as a new member
$members (array) Roles which are automatically added as members of the role
$adminmembers (array) Roles which are automatically added as admin members of the role
$memberofold (array) Original roles whose the role belongs to
$membersold (array) Original roles that are members of the role
$adminmembersold (array) Original roles that are admin members of the role

setRule() публичный Метод

Edits a rule on a table OR view
public setRule ( $name, $event, $table, $where, $instead, $type, $action ) : -1
$name The name of the new rule
$event SELECT, INSERT, UPDATE or DELETE
$table Table on which to create the rule
$where When to execute the rule, '' indicates always
$instead True if an INSTEAD rule, false otherwise
$type NOTHING for a do nothing rule, SOMETHING to use given action
$action The action to take
Результат -1

setSchema() публичный Метод

Sets the current working schema. Will also set Class variable.
public setSchema ( $schema )
$schema The the name of the schema to work in

setSearchPath() публичный Метод

Sets the current schema search path
public setSearchPath ( $paths ) : -2
$paths An array of schemas in required search order
Результат -2

setUser() публичный Метод

Adjusts a user's info
public setUser ( $username, $password, $createdb, $createuser, $expiry )
$username The username of the user to modify
$password A new password for the user
$createdb boolean Whether or not the user can create databases
$createuser boolean Whether or not the user can create other users
$expiry string Format 'YYYY-MM-DD HH:MM:SS'. '' means never expire.

setView() публичный Метод

Updates a view.
public setView ( $viewname, $definition, $comment ) : -3
$viewname The name fo the view to update
$definition The new definition for the view
Результат -3

setvalSequence() публичный Метод

Execute setval on a given sequence
public setvalSequence ( $sequence, $nextvalue ) : -1
$sequence Sequence name
$nextvalue The next value
Результат -1

updateFtsConfiguration() публичный Метод

Alters FTS configuration
public updateFtsConfiguration ( $cfgname, $comment, $name )
$cfgname The conf's name
$comment A comment on for the conf
$name The new conf name

updateFtsDictionary() публичный Метод

Alters FTS dictionary or dictionary template
public updateFtsDictionary ( $dictname, $comment, $name )
$dictname The dico's name
$comment The comment
$name The new dico's name

updateSchema() публичный Метод

Updates a schema.
public updateSchema ( $schemaname, $comment, $name, $owner )
$schemaname The name of the schema to drop
$comment The new comment for this schema
$owner The new owner for this schema

vacuumDB() публичный Метод

Vacuums a database
public vacuumDB ( $table = '', $analyze = false, $full = false, $freeze = false )
$table The table to vacuum
$analyze If true, also does analyze
$full If true, selects "full" vacuum
$freeze If true, selects aggressive "freezing" of tuples

Описание свойств

$_maxNameLen публичное свойство

Max object name length
public $_maxNameLen

$_schema публичное свойство

Store the current schema
public $_schema

$codemap публичное свойство

encoding name is the same as its database encoding name.
public $codemap

$defaultprops публичное свойство

public $defaultprops

$extraTypes публичное свойство

Extra "magic" types. BIGSERIAL was added in PostgreSQL 7.2.
public $extraTypes

$fkactions публичное свойство

Foreign key stuff. First element MUST be the default.
public $fkactions

$fkdeferrable публичное свойство

public $fkdeferrable

$fkinitial публичное свойство

public $fkinitial

$fkmatches публичное свойство

public $fkmatches

$funcprops публичное свойство

Function properties
public $funcprops

$help_base публичное свойство

Default help URL
public $help_base

$help_page публичное свойство

Help sub pages
public $help_page

$id публичное свойство

Name of id column
public $id

$joinOps публичное свойство

Supported join operations for use with view wizard
public $joinOps

$langmap публичное свойство

Map of internal language name to syntax highlighting name
public $langmap

$major_version публичное свойство

public $major_version

$predefined_size_types публичное свойство

Predefined size types
public $predefined_size_types

$privlist публичное свойство

of objects.
public $privlist

$privmap публичное свойство

refer to.
public $privmap

$rule_events публичное свойство

Rule action types
public $rule_events

$selectOps публичное свойство

Select operators
public $selectOps

$triggerEvents публичное свойство

Array of allowed trigger events
public $triggerEvents

$triggerExecTimes публичное свойство

When to execute the trigger
public $triggerExecTimes

$triggerFrequency публичное свойство

How often to execute the trigger
public $triggerFrequency

$typAlignDef публичное свойство

The default type alignment
public $typAlignDef

$typAligns публичное свойство

Array of allowed type alignments
public $typAligns

$typIndexDef публичное свойство

Default index type
public $typIndexDef

$typIndexes публичное свойство

Array of allowed index types
public $typIndexes

$typStorageDef публичное свойство

The default type storage
public $typStorageDef

$typStorages публичное свойство

Array of allowed type storage attributes
public $typStorages