|
MediaWiki
REL1_23
|


Public Member Functions | |
| addQuotes ($s) | |
| affectedRows () | |
| Get the number of rows affected by the last write query. | |
| aggregateValue ($valuedata, $valuename= 'value') | |
| Return aggregated value function call. | |
| buildConcat ($stringList) | |
| Build a concatenation list to feed into a SQL query. | |
| buildGroupConcatField ($delimiter, $table, $field, $conds= '', $options=array(), $join_conds=array()) | |
| cascadingDeletes () | |
| Returns true if this database supports (and uses) cascading deletes. | |
| cleanupTriggers () | |
| Returns true if this database supports (and uses) triggers (e.g. | |
| constraintExists ($table, $constraint) | |
| currentSequenceValue ($seqName) | |
| Return the current value of a sequence. | |
| dataSeek ($res, $row) | |
| decodeBlob ($b) | |
| Some DBMSs return a special placeholder object representing blob fields in result objects. | |
| determineCoreSchema ($desiredSchema) | |
| Determine default schema for MediaWiki core Adjust this session schema search path if desired schema exists and is not alread there. | |
| doQuery ($sql) | |
| The DBMS-dependent part of query() | |
| duplicateTableStructure ($oldName, $newName, $temporary=false, $fname=__METHOD__) | |
| Creates a new table with structure copied from existing table Note that unlike most database abstraction functions, this function does not automatically append database prefix, because it works at a lower abstraction level. | |
| encodeBlob ($b) | |
| estimateRowCount ($table, $vars= '*', $conds= '', $fname=__METHOD__, $options=array()) | |
| Estimate rows in dataset Returns estimated count, based on EXPLAIN output This is not necessarily an accurate estimate, so use sparingly Returns -1 if count cannot be found Takes same arguments as Database::select() | |
| fetchObject ($res) | |
| fetchRow ($res) | |
| Fetch the next row from the given result object, in associative array form. | |
| fieldInfo ($table, $field) | |
| mysql_fetch_field() wrapper Returns false if the field doesn't exist | |
| fieldName ($res, $n) | |
| Get a field name in a result object. | |
| fieldType ($res, $index) | |
| pg_field_type() wrapper | |
| freeResult ($res) | |
| functionalIndexes () | |
| Returns true if this database can use functional indexes. | |
| getCoreSchema () | |
| Return schema name fore core MediaWiki tables. | |
| getCurrentSchema () | |
| Return current schema (executes SELECT current_schema()) Needs transaction. | |
| getDBname () | |
| Get the current DB name. | |
| getSchemas () | |
| Return list of schemas which are accessible without schema name This is list does not contain magic keywords like "$user" Needs transaction. | |
| getSearchEngine () | |
| Get search engine class. | |
| getSearchPath () | |
| Return search patch for schemas This is different from getSchemas() since it contain magic keywords (like "$user"). | |
| getServer () | |
| Get the server hostname or IP address. | |
| getServerVersion () | |
| getSoftwareLink () | |
| getType () | |
| Get the type of the DBMS, as it appears in $wgDBtype. | |
| hasConstraint ($name) | |
| implicitGroupby () | |
| Returns true if this database does an implicit sort when doing GROUP BY. | |
| implicitOrderby () | |
| Returns true if this database does an implicit order by when the column has an index For example: SELECT page_title FROM page LIMIT 1. | |
| indexAttributes ($index, $schema=false) | |
| Returns is of attributes used in index. | |
| indexInfo ($table, $index, $fname=__METHOD__) | |
| Returns information about an index If errors are explicitly ignored, returns NULL on failure. | |
| indexUnique ($table, $index, $fname=__METHOD__) | |
| insert ($table, $args, $fname=__METHOD__, $options=array()) | |
| INSERT wrapper, inserts an array into a table. | |
| insertId () | |
| Return the result of the last call to nextSequenceValue(); This must be called after nextSequenceValue(). | |
| insertSelect ($destTable, $srcTable, $varMap, $conds, $fname=__METHOD__, $insertOptions=array(), $selectOptions=array()) | |
| INSERT SELECT wrapper $varMap must be an associative array of the form array( 'dest1' => 'source1', ...) Source items may be literals rather then field names, but strings should be quoted with Database::addQuotes() $conds may be "*" to copy the whole table srcTable may be an array of tables. | |
| lastErrno () | |
| Get the last error number. | |
| lastError () | |
| Get a description of the last error. | |
| limitResult ($sql, $limit, $offset=false) | |
| Construct a LIMIT query with optional offset. | |
| listTables ($prefix=null, $fname=__METHOD__) | |
| List all tables on the database. | |
| lock ($lockName, $method, $timeout=5) | |
| See http://www.postgresql.org/docs/8.2/static/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS. | |
| lockIsFree ($lockName, $method) | |
| Check to see if a named lock is available. | |
| makeConnectionString ($vars) | |
| makeSelectOptions ($options) | |
| Various select options. | |
| nextSequenceValue ($seqName) | |
| Return the next in a sequence, save the value for retrieval via insertId() | |
| numFields ($res) | |
| Get the number of fields in a result object. | |
| numRows ($res) | |
| Get the number of rows in a result object. | |
| open ($server, $user, $password, $dbName) | |
| Usually aborts on failure. | |
| pg_array_parse ($text, &$output, $limit=false, $offset=1) | |
| queryIgnore ($sql, $fname=__METHOD__) | |
| realTableName ($name, $format= 'quoted') | |
| realTimestamps () | |
| Returns true if this database uses timestamps rather than integers. | |
| relationExists ($table, $types, $schema=false) | |
| Query whether a given relation exists (in the given schema, or the default mw one if not given) | |
| reportQueryError ($error, $errno, $sql, $fname, $tempIgnore=false) | |
| Report a query error. | |
| roleExists ($roleName) | |
| Returns true if a given role (i.e. | |
| ruleExists ($table, $rule) | |
| schemaExists ($schema) | |
| Query whether a given schema exists. | |
| searchableIPs () | |
| Returns true if this database can do a native search on IP columns e.g. | |
| selectDB ($db) | |
| Postgres doesn't support selectDB in the same way MySQL does. | |
| selectSQLText ($table, $vars, $conds= '', $fname=__METHOD__, $options=array(), $join_conds=array()) | |
| Change the FOR UPDATE option as necessary based on the join conditions. | |
| sequenceExists ($sequence, $schema=false) | |
| setSearchPath ($search_path) | |
| Update search_path, values should already be sanitized Values may contain magic keywords like "$user". | |
| streamStatementEnd (&$sql, &$newLine) | |
| Called by sourceStream() to check if we've reached a statement end. | |
| strencode ($s) | |
| Wrapper for addslashes() | |
| strictIPs () | |
| Returns true if this database is strict about what can be put into an IP field. | |
| tableExists ($table, $fname=__METHOD__, $schema=false) | |
| For backward compatibility, this function checks both tables and views. | |
| tableName ($name, $format= 'quoted') | |
| Format a table name ready for use in constructing an SQL query. | |
| textFieldSize ($table, $field) | |
| Returns the size of a text field, or -1 for "unlimited". | |
| timestamp ($ts=0) | |
| Convert a timestamp in one of the formats accepted by wfTimestamp() to the format used for inserting into timestamp fields in this DBMS. | |
| triggerExists ($table, $trigger) | |
| unlock ($lockName, $method) | |
| See http://www.postgresql.org/docs/8.2/static/functions-admin.html#FUNCTIONS-ADVISORY-LOCKSFROM PG DOCS: http://www.postgresql.org/docs/8.2/static/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS. | |
| wasDeadlock () | |
| Determines if the last failure was due to a deadlock STUB. | |
Protected Member Functions | |
| closeConnection () | |
| Closes a database connection, if it is open Returns success, true if already closed. | |
| dumpError () | |
| replaceVars ($ins) | |
| Postgres specific version of replaceVars. | |
Protected Attributes | |
| int | $mAffectedRows = null |
| The number of rows affected as an integer *. | |
| resource | $mLastResult = null |
| * | |
Private Member Functions | |
| bigintFromLockName ($lockName) | |
Private Attributes | |
| string | $connectString |
| Connect string to open a PostgreSQL connection *. | |
| string | $mCoreSchema |
| * | |
| int | $mInsertId = null |
| * | |
| PostgresTransactionState | $mTransactionState |
| * | |
| float string | $numericVersion = null |
| * | |
Definition at line 290 of file DatabasePostgres.php.
| DatabasePostgres::addQuotes | ( | $ | s | ) |
| null | bool | Blob | $s |
Reimplemented from DatabaseBase.
Definition at line 1501 of file DatabasePostgres.php.
Referenced by lockIsFree(), and streamStatementEnd().
Get the number of rows affected by the last write query.
Implements DatabaseType.
Definition at line 667 of file DatabasePostgres.php.
| DatabasePostgres::aggregateValue | ( | $ | valuedata, |
| $ | valuename = 'value' |
||
| ) |
Return aggregated value function call.
Reimplemented from DatabaseBase.
Definition at line 1194 of file DatabasePostgres.php.
| DatabasePostgres::bigintFromLockName | ( | $ | lockName | ) | [private] |
| string | $lockName |
Definition at line 1674 of file DatabasePostgres.php.
Referenced by lockIsFree().
| DatabasePostgres::buildConcat | ( | $ | stringList | ) |
Build a concatenation list to feed into a SQL query.
| array | $stringList | List of raw SQL expressions; caller is responsible for any quoting |
Reimplemented from DatabaseBase.
Definition at line 1584 of file DatabasePostgres.php.
| DatabasePostgres::buildGroupConcatField | ( | $ | delimiter, |
| $ | table, | ||
| $ | field, | ||
| $ | conds = '', |
||
| $ | options = array(), |
||
| $ | join_conds = array() |
||
| ) |
Definition at line 1588 of file DatabasePostgres.php.
Returns true if this database supports (and uses) cascading deletes.
Reimplemented from DatabaseBase.
Definition at line 309 of file DatabasePostgres.php.
Returns true if this database supports (and uses) triggers (e.g.
on the page table)
Reimplemented from DatabaseBase.
Definition at line 313 of file DatabasePostgres.php.
| DatabasePostgres::closeConnection | ( | ) | [protected] |
Closes a database connection, if it is open Returns success, true if already closed.
Reimplemented from DatabaseBase.
Definition at line 470 of file DatabasePostgres.php.
| DatabasePostgres::constraintExists | ( | $ | table, |
| $ | constraint | ||
| ) |
Definition at line 1419 of file DatabasePostgres.php.
| DatabasePostgres::currentSequenceValue | ( | $ | seqName | ) |
Return the current value of a sequence.
Assumes it has been nextval'ed in this session.
| string | $seqName |
Definition at line 1083 of file DatabasePostgres.php.
| DatabasePostgres::dataSeek | ( | $ | res, |
| $ | row | ||
| ) |
| mixed | $res | |
| int | $row |
Implements DatabaseType.
Definition at line 639 of file DatabasePostgres.php.
| DatabasePostgres::decodeBlob | ( | $ | b | ) |
Some DBMSs return a special placeholder object representing blob fields in result objects.
Pass the object through this function to return the original string.
| string | $b |
Reimplemented from DatabaseBase.
Definition at line 1485 of file DatabasePostgres.php.
| DatabasePostgres::determineCoreSchema | ( | $ | desiredSchema | ) |
Determine default schema for MediaWiki core Adjust this session schema search path if desired schema exists and is not alread there.
We need to have name of the core schema stored to be able to query database metadata.
This will be also called by the installer after the schema is created
| string | $desiredSchema |
Definition at line 1282 of file DatabasePostgres.php.
Referenced by open().
| DatabasePostgres::doQuery | ( | $ | sql | ) |
The DBMS-dependent part of query()
| string | $sql | SQL query. |
Reimplemented from DatabaseBase.
Definition at line 474 of file DatabasePostgres.php.
Referenced by open().
| DatabasePostgres::dumpError | ( | ) | [protected] |
Definition at line 492 of file DatabasePostgres.php.
| DatabasePostgres::duplicateTableStructure | ( | $ | oldName, |
| $ | newName, | ||
| $ | temporary = false, |
||
| $ | fname = __METHOD__ |
||
| ) |
Creates a new table with structure copied from existing table Note that unlike most database abstraction functions, this function does not automatically append database prefix, because it works at a lower abstraction level.
The table names passed to this function shall not be quoted (this function calls addIdentifierQuotes when needed).
| string | $oldName | Name of table whose structure should be copied |
| string | $newName | Name of table to be created |
| bool | $temporary | Whether the new table should be temporary |
| string | $fname | Calling function name |
| MWException |
Reimplemented from DatabaseBase.
Definition at line 1118 of file DatabasePostgres.php.
| DatabasePostgres::encodeBlob | ( | $ | b | ) |
| string | $b |
Reimplemented from DatabaseBase.
Definition at line 1481 of file DatabasePostgres.php.
| DatabasePostgres::estimateRowCount | ( | $ | table, |
| $ | vars = '*', |
||
| $ | conds = '', |
||
| $ | fname = __METHOD__, |
||
| $ | options = array() |
||
| ) |
Estimate rows in dataset Returns estimated count, based on EXPLAIN output This is not necessarily an accurate estimate, so use sparingly Returns -1 if count cannot be found Takes same arguments as Database::select()
| string | $table | |
| string | $vars | |
| string | $conds | |
| string | $fname | |
| array | $options |
Reimplemented from DatabaseBase.
Definition at line 693 of file DatabasePostgres.php.
| DatabasePostgres::fetchObject | ( | $ | res | ) |
| ResultWrapper | stdClass | $res |
| DBUnexpectedError |
Implements DatabaseType.
Definition at line 553 of file DatabasePostgres.php.
Referenced by lockIsFree().
| DatabasePostgres::fetchRow | ( | $ | res | ) |
Fetch the next row from the given result object, in associative array form.
Fields are retrieved with $row['fieldname']. If no more rows are available, false is returned.
| ResultWrapper | $res | Result object as returned from DatabaseBase::query(), etc. |
| DBUnexpectedError | Thrown if the database returns an error |
Implements DatabaseType.
Definition at line 574 of file DatabasePostgres.php.
Referenced by getSearchPath(), and textFieldSize().
| DatabasePostgres::fieldInfo | ( | $ | table, |
| $ | field | ||
| ) |
mysql_fetch_field() wrapper Returns false if the field doesn't exist
| string | $table | Table name |
| string | $field | Field name |
Implements DatabaseType.
Definition at line 1459 of file DatabasePostgres.php.
| DatabasePostgres::fieldName | ( | $ | res, |
| $ | n | ||
| ) |
Get a field name in a result object.
| mixed | $res | A SQL result |
| int | $n |
Implements DatabaseType.
Definition at line 616 of file DatabasePostgres.php.
| DatabasePostgres::fieldType | ( | $ | res, |
| $ | index | ||
| ) |
pg_field_type() wrapper
| ResultWrapper | resource | $res | ResultWrapper or PostgreSQL query result resource |
| int | $index | Field number, starting from 0 |
Definition at line 1469 of file DatabasePostgres.php.
References PostgresField\fromText().
| DatabasePostgres::freeResult | ( | $ | res | ) |
| stdClass | ResultWrapper | $res |
| DBUnexpectedError |
Reimplemented from DatabaseBase.
Definition at line 536 of file DatabasePostgres.php.
Returns true if this database can use functional indexes.
Reimplemented from DatabaseBase.
Definition at line 337 of file DatabasePostgres.php.
Return schema name fore core MediaWiki tables.
Definition at line 1316 of file DatabasePostgres.php.
Return current schema (executes SELECT current_schema()) Needs transaction.
Definition at line 1212 of file DatabasePostgres.php.
Get the current DB name.
Reimplemented from DatabaseBase.
Definition at line 1576 of file DatabasePostgres.php.
Return list of schemas which are accessible without schema name This is list does not contain magic keywords like "$user" Needs transaction.
Definition at line 1229 of file DatabasePostgres.php.
Get search engine class.
All subclasses of this need to implement this if they wish to use searching.
Reimplemented from DatabaseBase.
Definition at line 1596 of file DatabasePostgres.php.
Return search patch for schemas This is different from getSchemas() since it contain magic keywords (like "$user").
Needs transaction
Definition at line 1248 of file DatabasePostgres.php.
References $res, fetchRow(), and DatabaseBase\query().
Get the server hostname or IP address.
Reimplemented from DatabaseBase.
Definition at line 1580 of file DatabasePostgres.php.
Implements DatabaseType.
Definition at line 1323 of file DatabasePostgres.php.
Referenced by open().
Implements DatabaseType.
Definition at line 1201 of file DatabasePostgres.php.
Get the type of the DBMS, as it appears in $wgDBtype.
Implements DatabaseType.
Definition at line 305 of file DatabasePostgres.php.
| DatabasePostgres::hasConstraint | ( | $ | name | ) |
Definition at line 341 of file DatabasePostgres.php.
Returns true if this database does an implicit sort when doing GROUP BY.
Reimplemented from DatabaseBase.
Definition at line 325 of file DatabasePostgres.php.
Returns true if this database does an implicit order by when the column has an index For example: SELECT page_title FROM page LIMIT 1.
Reimplemented from DatabaseBase.
Definition at line 329 of file DatabasePostgres.php.
| DatabasePostgres::indexAttributes | ( | $ | index, |
| $ | schema = false |
||
| ) |
Returns is of attributes used in index.
| string | $index | |
| bool | string | $schema |
Definition at line 742 of file DatabasePostgres.php.
| DatabasePostgres::indexInfo | ( | $ | table, |
| $ | index, | ||
| $ | fname = __METHOD__ |
||
| ) |
Returns information about an index If errors are explicitly ignored, returns NULL on failure.
| string | $table | |
| string | $index | |
| string | $fname |
Implements DatabaseType.
Definition at line 719 of file DatabasePostgres.php.
References $fname, $res, as, and DatabaseBase\query().
| DatabasePostgres::indexUnique | ( | $ | table, |
| $ | index, | ||
| $ | fname = __METHOD__ |
||
| ) |
Definition at line 799 of file DatabasePostgres.php.
| DatabasePostgres::insert | ( | $ | table, |
| $ | args, | ||
| $ | fname = __METHOD__, |
||
| $ | options = array() |
||
| ) |
INSERT wrapper, inserts an array into a table.
$args may be a single associative array, or an array of these with numeric keys, for multi-row insert (Postgres version 8.2 and above only).
| string | $table | Name of the table to insert to. |
| array | $args | Items to insert into the table. |
| string | $fname | Name of the function, for profiling |
| array | string | $options | String or array. Valid options: IGNORE |
Reimplemented from DatabaseBase.
Definition at line 857 of file DatabasePostgres.php.
Return the result of the last call to nextSequenceValue(); This must be called after nextSequenceValue().
Implements DatabaseType.
Definition at line 630 of file DatabasePostgres.php.
| DatabasePostgres::insertSelect | ( | $ | destTable, |
| $ | srcTable, | ||
| $ | varMap, | ||
| $ | conds, | ||
| $ | fname = __METHOD__, |
||
| $ | insertOptions = array(), |
||
| $ | selectOptions = array() |
||
| ) |
INSERT SELECT wrapper $varMap must be an associative array of the form array( 'dest1' => 'source1', ...) Source items may be literals rather then field names, but strings should be quoted with Database::addQuotes() $conds may be "*" to copy the whole table srcTable may be an array of tables.
| string | $destTable | |
| array | string | $srcTable | |
| array | $varMap | |
| array | $conds | |
| string | $fname | |
| array | $insertOptions | |
| array | $selectOptions |
Reimplemented from DatabaseBase.
Definition at line 983 of file DatabasePostgres.php.
Get the last error number.
Implements DatabaseType.
Definition at line 659 of file DatabasePostgres.php.
Get a description of the last error.
Implements DatabaseType.
Definition at line 647 of file DatabasePostgres.php.
Referenced by open().
| DatabasePostgres::limitResult | ( | $ | sql, |
| $ | limit, | ||
| $ | offset = false |
||
| ) |
Construct a LIMIT query with optional offset.
This is used for query pages. The SQL should be adjusted so that only the first $limit rows are returned. If $offset is provided as well, then the first $offset rows should be discarded, and the next $limit rows should be returned. If the result of the query is not ordered, then the rows to be returned are theoretically arbitrary.
$sql is expected to be a SELECT, if that makes a difference.
The version provided by default works in MySQL and SQLite. It will very likely need to be overridden for most other DBMSes.
| string | $sql | SQL query we will append the limit too |
| int | $limit | The SQL limit |
| int | bool | $offset | The SQL offset (default false) |
| DBUnexpectedError |
Reimplemented from DatabaseBase.
Definition at line 1110 of file DatabasePostgres.php.
| DatabasePostgres::listTables | ( | $ | prefix = null, |
| $ | fname = __METHOD__ |
||
| ) |
List all tables on the database.
| string | $prefix | Only show tables with this prefix, e.g. mw_ |
| string | $fname | Calling function name |
| MWException |
Reimplemented from DatabaseBase.
Definition at line 1126 of file DatabasePostgres.php.
| DatabasePostgres::lock | ( | $ | lockName, |
| $ | method, | ||
| $ | timeout = 5 |
||
| ) |
See http://www.postgresql.org/docs/8.2/static/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS.
| string | $lockName | |
| string | $method | |
| int | $timeout |
Reimplemented from DatabaseBase.
Definition at line 1638 of file DatabasePostgres.php.
| DatabasePostgres::lockIsFree | ( | $ | lockName, |
| $ | method | ||
| ) |
Check to see if a named lock is available.
This is non-blocking. See http://www.postgresql.org/docs/8.2/static/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS
| string | $lockName | Name of lock to poll |
| string | $method | Name of method calling us |
Reimplemented from DatabaseBase.
Definition at line 1622 of file DatabasePostgres.php.
References $key, $result, addQuotes(), bigintFromLockName(), fetchObject(), and DatabaseBase\query().
| DatabasePostgres::makeConnectionString | ( | $ | vars | ) |
Definition at line 456 of file DatabasePostgres.php.
Referenced by open().
| DatabasePostgres::makeSelectOptions | ( | $ | options | ) |
Various select options.
| array | $options | an associative array of options to be turned into an SQL query, valid keys are listed in the function. |
Reimplemented from DatabaseBase.
Definition at line 1542 of file DatabasePostgres.php.
| DatabasePostgres::nextSequenceValue | ( | $ | seqName | ) |
Return the next in a sequence, save the value for retrieval via insertId()
| string | $seqName |
Reimplemented from DatabaseBase.
Definition at line 1068 of file DatabasePostgres.php.
References $name, and tableName().
| DatabasePostgres::numFields | ( | $ | res | ) |
Get the number of fields in a result object.
| mixed | $res | A SQL result |
Implements DatabaseType.
Definition at line 608 of file DatabasePostgres.php.
| DatabasePostgres::numRows | ( | $ | res | ) |
Get the number of rows in a result object.
| mixed | $res | A SQL result |
Implements DatabaseType.
Definition at line 591 of file DatabasePostgres.php.
| DatabasePostgres::open | ( | $ | server, |
| $ | user, | ||
| $ | password, | ||
| $ | dbName | ||
| ) |
Usually aborts on failure.
| string | $server | |
| string | $user | |
| string | $password | |
| string | $dbName |
| DBConnectionError|Exception |
Implements DatabaseType.
Definition at line 360 of file DatabasePostgres.php.
References $password, $user, $wgCommandLineMode, array(), DatabaseBase\close(), determineCoreSchema(), doQuery(), e, getServerVersion(), global, DatabaseBase\installErrorHandler(), is, lastError(), makeConnectionString(), DatabaseBase\query(), DatabaseBase\restoreErrorHandler(), and wfDebug().
| DatabasePostgres::pg_array_parse | ( | $ | text, |
| &$ | output, | ||
| $ | limit = false, |
||
| $ | offset = 1 |
||
| ) |
Definition at line 1164 of file DatabasePostgres.php.
| DatabasePostgres::queryIgnore | ( | $ | sql, |
| $ | fname = __METHOD__ |
||
| ) |
Definition at line 528 of file DatabasePostgres.php.
| DatabasePostgres::realTableName | ( | $ | name, |
| $ | format = 'quoted' |
||
| ) |
Definition at line 1058 of file DatabasePostgres.php.
Returns true if this database uses timestamps rather than integers.
Reimplemented from DatabaseBase.
Definition at line 321 of file DatabasePostgres.php.
| DatabasePostgres::relationExists | ( | $ | table, |
| $ | types, | ||
| $ | schema = false |
||
| ) |
Query whether a given relation exists (in the given schema, or the default mw one if not given)
| string | $table | |
| array | string | $types | |
| bool | string | $schema |
Definition at line 1349 of file DatabasePostgres.php.
| DatabasePostgres::replaceVars | ( | $ | ins | ) | [protected] |
Postgres specific version of replaceVars.
Calls the parent version in Database.php
| string | $ins | SQL string, read from a stream (usually tables.sql) |
Reimplemented from DatabaseBase.
Definition at line 1520 of file DatabasePostgres.php.
| DatabasePostgres::reportQueryError | ( | $ | error, |
| $ | errno, | ||
| $ | sql, | ||
| $ | fname, | ||
| $ | tempIgnore = false |
||
| ) |
Report a query error.
Log the error, and if neither the object ignore flag nor the $tempIgnore flag is set, throw a DBQueryError.
| string | $error | |
| int | $errno | |
| string | $sql | |
| string | $fname | |
| bool | $tempIgnore |
| DBQueryError |
Reimplemented from DatabaseBase.
Definition at line 513 of file DatabasePostgres.php.
| DatabasePostgres::roleExists | ( | $ | roleName | ) |
Returns true if a given role (i.e.
user) exists, false otherwise.
| string | $roleName |
Definition at line 1452 of file DatabasePostgres.php.
| DatabasePostgres::ruleExists | ( | $ | table, |
| $ | rule | ||
| ) |
Definition at line 1407 of file DatabasePostgres.php.
| DatabasePostgres::schemaExists | ( | $ | schema | ) |
Query whether a given schema exists.
Returns true if it does, false if it doesn't.
| string | $schema |
Definition at line 1440 of file DatabasePostgres.php.
Returns true if this database can do a native search on IP columns e.g.
this works as expected: .. WHERE rc_ip = '127.42.12.102/32';
Reimplemented from DatabaseBase.
Definition at line 333 of file DatabasePostgres.php.
| DatabasePostgres::selectDB | ( | $ | db | ) |
Postgres doesn't support selectDB in the same way MySQL does.
So if the DB name doesn't match the open connection, open a new one
| string | $db |
Reimplemented from DatabaseBase.
Definition at line 448 of file DatabasePostgres.php.
| DatabasePostgres::selectSQLText | ( | $ | table, |
| $ | vars, | ||
| $ | conds = '', |
||
| $ | fname = __METHOD__, |
||
| $ | options = array(), |
||
| $ | join_conds = array() |
||
| ) |
Change the FOR UPDATE option as necessary based on the join conditions.
Then pass to the parent function to get the actual SQL text.
In Postgres when using FOR UPDATE, only the main table and tables that are inner joined can be locked. That means tables in an outer join cannot be FOR UPDATE locked. Trying to do so causes a DB error. This wrapper checks which tables can be locked and adjusts it accordingly.
MySQL uses "ORDER BY NULL" as an optimization hint, but that syntax is illegal in PostgreSQL.
Reimplemented from DatabaseBase.
Definition at line 822 of file DatabasePostgres.php.
Referenced by streamStatementEnd().
| DatabasePostgres::sequenceExists | ( | $ | sequence, |
| $ | schema = false |
||
| ) |
Definition at line 1380 of file DatabasePostgres.php.
| DatabasePostgres::setSearchPath | ( | $ | search_path | ) |
Update search_path, values should already be sanitized Values may contain magic keywords like "$user".
| $search_path | array list of schemas to be searched by default |
Definition at line 1264 of file DatabasePostgres.php.
| DatabasePostgres::streamStatementEnd | ( | &$ | sql, |
| &$ | newLine | ||
| ) |
Called by sourceStream() to check if we've reached a statement end.
| string | $sql | SQL assembled so far |
| string | $newLine | New line about to be added to $sql |
Reimplemented from DatabaseBase.
Definition at line 1600 of file DatabasePostgres.php.
References $conds, DatabaseBase\$delimiter, addQuotes(), array(), and selectSQLText().
| DatabasePostgres::strencode | ( | $ | s | ) |
Wrapper for addslashes()
| string | $s | String to be slashed. |
Implements DatabaseType.
Definition at line 1493 of file DatabasePostgres.php.
Returns true if this database is strict about what can be put into an IP field.
Specifically, it uses a NULL value instead of an empty string.
Reimplemented from DatabaseBase.
Definition at line 317 of file DatabasePostgres.php.
| DatabasePostgres::tableExists | ( | $ | table, |
| $ | fname = __METHOD__, |
||
| $ | schema = false |
||
| ) |
For backward compatibility, this function checks both tables and views.
| string | $table | |
| string | $fname | |
| bool | string | $schema |
Definition at line 1376 of file DatabasePostgres.php.
| DatabasePostgres::tableName | ( | $ | name, |
| $ | format = 'quoted' |
||
| ) |
Format a table name ready for use in constructing an SQL query.
This does two important things: it quotes the table names to clean them up, and it adds a table prefix if only given a table name with no quotes.
All functions of this object which require a table name call this function themselves. Pass the canonical name to such functions. This is only needed when calling query() directly.
| string | $name | Database table name |
| string | $format | One of: quoted - Automatically pass the table name through addIdentifierQuotes() so that it can be used in a query. raw - Do not add identifier quotes to the table name |
Reimplemented from DatabaseBase.
Definition at line 1045 of file DatabasePostgres.php.
Referenced by nextSequenceValue().
| DatabasePostgres::textFieldSize | ( | $ | table, |
| $ | field | ||
| ) |
Returns the size of a text field, or -1 for "unlimited".
| string | $table | |
| string | $field |
Reimplemented from DatabaseBase.
Definition at line 1093 of file DatabasePostgres.php.
References $res, fetchRow(), and DatabaseBase\query().
| DatabasePostgres::timestamp | ( | $ | ts = 0 | ) |
Convert a timestamp in one of the formats accepted by wfTimestamp() to the format used for inserting into timestamp fields in this DBMS.
The result is unquoted, and needs to be passed through addQuotes() before it can be included in raw SQL.
| string | int | $ts |
Reimplemented from DatabaseBase.
Definition at line 1142 of file DatabasePostgres.php.
| DatabasePostgres::triggerExists | ( | $ | table, |
| $ | trigger | ||
| ) |
Definition at line 1384 of file DatabasePostgres.php.
| DatabasePostgres::unlock | ( | $ | lockName, |
| $ | method | ||
| ) |
See http://www.postgresql.org/docs/8.2/static/functions-admin.html#FUNCTIONS-ADVISORY-LOCKSFROM PG DOCS: http://www.postgresql.org/docs/8.2/static/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS.
| string | $lockName | |
| string | $method |
Reimplemented from DatabaseBase.
Definition at line 1662 of file DatabasePostgres.php.
Determines if the last failure was due to a deadlock STUB.
Reimplemented from DatabaseBase.
Definition at line 1114 of file DatabasePostgres.php.
string DatabasePostgres::$connectString [private] |
Connect string to open a PostgreSQL connection *.
Definition at line 299 of file DatabasePostgres.php.
int DatabasePostgres::$mAffectedRows = null [protected] |
The number of rows affected as an integer *.
Definition at line 293 of file DatabasePostgres.php.
string DatabasePostgres::$mCoreSchema [private] |
*
Definition at line 303 of file DatabasePostgres.php.
int DatabasePostgres::$mInsertId = null [private] |
*
Definition at line 295 of file DatabasePostgres.php.
resource DatabasePostgres::$mLastResult = null [protected] |
*
Definition at line 291 of file DatabasePostgres.php.
PostgresTransactionState DatabasePostgres::$mTransactionState [private] |
*
Definition at line 301 of file DatabasePostgres.php.
float string DatabasePostgres::$numericVersion = null [private] |
*
Definition at line 297 of file DatabasePostgres.php.