Public Member Functions | |
DatabasePostgres ($server=false, $user=false, $password=false, $dbName=false, $failFunction=false, $flags=0) | |
cascadingDeletes () | |
Returns true if this database supports (and uses) cascading deletes. | |
cleanupTriggers () | |
Returns true if this database supports (and uses) triggers (e.g. | |
strictIPs () | |
Returns true if this database is strict about what can be put into an IP field. | |
realTimestamps () | |
Returns true if this database uses timestamps rather than integers. | |
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. | |
searchableIPs () | |
Returns true if this database can do a native search on IP columns e.g. | |
functionalIndexes () | |
Returns true if this database can use functional indexes. | |
hasConstraint ($name) | |
open ($server, $user, $password, $dbName) | |
Usually aborts on failure If the failFunction is set to a non-zero integer, returns success. | |
makeConnectionString ($vars) | |
initial_setup ($password, $dbName) | |
setup_plpgsql () | |
close () | |
Closes a database connection, if it is open Returns success, true if already closed. | |
doQuery ($sql) | |
The DBMS-dependent part of query(). | |
queryIgnore ($sql, $fname= '') | |
freeResult ($res) | |
Free a result object. | |
fetchObject ($res) | |
Fetch the next row from the given result object, in object form. | |
fetchRow ($res) | |
Fetch the next row from the given result object, in associative array form. | |
numRows ($res) | |
Get the number of rows in a result object. | |
numFields ($res) | |
Get the number of fields in a result object See documentation for mysql_num_fields(). | |
fieldName ($res, $n) | |
Get a field name in a result object See documentation for mysql_field_name(): http://www.php.net/mysql_field_name. | |
insertId () | |
This must be called after nextSequenceVal. | |
dataSeek ($res, $row) | |
Change the position of the cursor in a result object See mysql_data_seek(). | |
lastError () | |
Get a description of the last error See mysql_error() for more details. | |
lastErrno () | |
Get the last error number See mysql_errno(). | |
affectedRows () | |
Get the number of rows affected by the last write query See mysql_affected_rows() for more details. | |
estimateRowCount ($table, $vars='*', $conds='', $fname= 'DatabasePostgres::estimateRowCount', $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(). | |
indexInfo ($table, $index, $fname= 'DatabasePostgres::indexInfo') | |
Returns information about an index If errors are explicitly ignored, returns NULL on failure. | |
indexUnique ($table, $index, $fname= 'DatabasePostgres::indexUnique') | |
insert ($table, $args, $fname= 'DatabasePostgres::insert', $options=array()) | |
INSERT wrapper, inserts an array into a table. | |
tableName ($name) | |
Format a table name ready for use in constructing an SQL query. | |
nextSequenceValue ($seqName) | |
Return the next in a sequence, save the value for retrieval via insertId(). | |
currentSequenceValue ($seqName) | |
Return the current value of a sequence. | |
useIndexClause ($index) | |
Postgres does not have a "USE INDEX" clause, so return an empty string. | |
replace ($table, $uniqueIndexes, $rows, $fname= 'DatabasePostgres::replace') | |
REPLACE query wrapper PostgreSQL simulates this with a DELETE followed by INSERT $row is the row to insert, an associative array $uniqueIndexes is an array of indexes. | |
deleteJoin ($delTable, $joinTable, $delVar, $joinVar, $conds, $fname= 'DatabasePostgres::deleteJoin') | |
DELETE where the condition is a join MySQL does this with a multi-table DELETE syntax, PostgreSQL does it with sub-selects. | |
textFieldSize ($table, $field) | |
Returns the size of a text field, or -1 for "unlimited". | |
lowPriorityOption () | |
limitResult ($sql, $limit, $offset=false) | |
Construct a LIMIT query with optional offset This is used for query pages. | |
conditional ($cond, $trueVal, $falseVal) | |
Returns an SQL expression for a simple conditional. | |
wasDeadlock () | |
Determines if the last failure was due to a deadlock. | |
timestamp ($ts=0) | |
Return MW-style timestamp used for MySQL schema. | |
aggregateValue ($valuedata, $valuename='value') | |
Return aggregated value function call. | |
reportQueryError ($error, $errno, $sql, $fname, $tempIgnore=false) | |
getSoftwareLink () | |
getServerVersion () | |
relationExists ($table, $types, $schema=false) | |
Query whether a given relation exists (in the given schema, or the default mw one if not given). | |
tableExists ($table, $schema=false) | |
sequenceExists ($sequence, $schema=false) | |
triggerExists ($table, $trigger) | |
ruleExists ($table, $rule) | |
constraintExists ($table, $constraint) | |
schemaExists ($schema) | |
Query whether a given schema exists. | |
fieldExists ($table, $field, $fname= 'DatabasePostgres::fieldExists') | |
Query whether a given column exists in the mediawiki schema. | |
fieldInfo ($table, $field) | |
mysql_fetch_field() wrapper Returns false if the field doesn't exist | |
fieldType ($res, $index) | |
pg_field_type() wrapper | |
begin ($fname= 'DatabasePostgres::begin') | |
Begin a transaction, committing any previously open transaction. | |
immediateCommit ($fname= 'DatabasePostgres::immediateCommit') | |
Commit transaction, if one is open. | |
commit ($fname= 'DatabasePostgres::commit') | |
End a transaction. | |
limitResultForUpdate ($sql, $num) | |
setup_database () | |
encodeBlob ($b) | |
decodeBlob ($b) | |
strencode ($s) | |
Wrapper for addslashes(). | |
addQuotes ($s) | |
If it's a string, adds quotes and backslashes Otherwise returns as-is. | |
quote_ident ($s) | |
selectDB ($db) | |
Change the current database. | |
makeSelectOptions ($options) | |
Various select options. | |
setTimeout ($timeout) | |
Override database's default connection timeout. | |
ping () | |
Ping the server and try to reconnect if it there is no connection. | |
getLag () | |
How lagged is this slave? | |
setFakeSlaveLag ($lag) | |
Set lag time in seconds for a fake slave. | |
setFakeMaster ($enabled=true) | |
Make this connection a fake master. | |
getDBname () | |
Get the current DB name. | |
getServer () | |
Get the server hostname or IP address. | |
buildConcat ($stringList) | |
lock ($lockName, $method) | |
Acquire a lock. | |
unlock ($lockName, $method) | |
Release a lock. | |
getSearchEngine () | |
Get search engine class. | |
Static Public Member Functions | |
static | newFromParams ($server, $user, $password, $dbName, $failFunction=false, $flags=0) |
Same as new Database( . | |
Public Attributes | |
$mInsertId = NULL | |
$mLastResult = NULL | |
$numeric_version = NULL | |
$mAffectedRows = NULL | |
Protected Member Functions | |
replaceVars ($ins) | |
Postgres specific version of replaceVars. |
Definition at line 71 of file DatabasePostgres.php.
DatabasePostgres::addQuotes | ( | $ | s | ) |
If it's a string, adds quotes and backslashes Otherwise returns as-is.
Reimplemented from Database.
Definition at line 1312 of file DatabasePostgres.php.
References $s.
Referenced by constraintExists(), initial_setup(), relationExists(), replace(), setup_database(), and triggerExists().
DatabasePostgres::affectedRows | ( | ) |
Get the number of rows affected by the last write query See mysql_affected_rows() for more details.
Reimplemented from Database.
Definition at line 674 of file DatabasePostgres.php.
DatabasePostgres::aggregateValue | ( | $ | valuedata, | |
$ | valuename = 'value' | |||
) |
Return aggregated value function call.
Reimplemented from Database.
Definition at line 1044 of file DatabasePostgres.php.
DatabasePostgres::begin | ( | $ | fname = 'DatabasePostgres::begin' |
) |
Begin a transaction, committing any previously open transaction.
Reimplemented from Database.
Definition at line 1221 of file DatabasePostgres.php.
References $fname, and Database::query().
Referenced by insert().
DatabasePostgres::buildConcat | ( | $ | stringList | ) |
DatabasePostgres::cascadingDeletes | ( | ) |
Returns true if this database supports (and uses) cascading deletes.
Reimplemented from Database.
Definition at line 87 of file DatabasePostgres.php.
DatabasePostgres::cleanupTriggers | ( | ) |
Returns true if this database supports (and uses) triggers (e.g.
on the page table)
Reimplemented from Database.
Definition at line 90 of file DatabasePostgres.php.
DatabasePostgres::close | ( | ) |
Closes a database connection, if it is open Returns success, true if already closed.
Reimplemented from Database.
Definition at line 567 of file DatabasePostgres.php.
Referenced by open().
DatabasePostgres::commit | ( | $ | fname = 'DatabasePostgres::commit' |
) |
End a transaction.
Reimplemented from Database.
Definition at line 1228 of file DatabasePostgres.php.
References $fname, and Database::query().
Referenced by insert().
DatabasePostgres::conditional | ( | $ | cond, | |
$ | trueVal, | |||
$ | falseVal | |||
) |
Returns an SQL expression for a simple conditional.
Uses CASE on Postgres
$cond | String: SQL expression which will result in a boolean value | |
$trueVal | String: SQL expression to return if true | |
$falseVal | String: SQL expression to return if false |
Reimplemented from Database.
Definition at line 1029 of file DatabasePostgres.php.
DatabasePostgres::constraintExists | ( | $ | table, | |
$ | constraint | |||
) |
Definition at line 1155 of file DatabasePostgres.php.
References $res, $rows, $wgDBmwschema, addQuotes(), freeResult(), and Database::query().
DatabasePostgres::currentSequenceValue | ( | $ | seqName | ) |
Return the current value of a sequence.
Assumes it has ben nextval'ed in this session.
Definition at line 903 of file DatabasePostgres.php.
References $res, $row, fetchRow(), freeResult(), and Database::query().
DatabasePostgres::DatabasePostgres | ( | $ | server = false , |
|
$ | user = false , |
|||
$ | password = false , |
|||
$ | dbName = false , |
|||
$ | failFunction = false , |
|||
$ | flags = 0 | |||
) |
Definition at line 77 of file DatabasePostgres.php.
References $flags, $password, $user, and open().
Referenced by newFromParams().
DatabasePostgres::dataSeek | ( | $ | res, | |
$ | row | |||
) |
Change the position of the cursor in a result object See mysql_data_seek().
$res | Mixed: A SQL result | |
$row | Mixed: Either MySQL row or ResultWrapper |
Reimplemented from Database.
Definition at line 655 of file DatabasePostgres.php.
DatabasePostgres::decodeBlob | ( | $ | b | ) |
DatabasePostgres::deleteJoin | ( | $ | delTable, | |
$ | joinTable, | |||
$ | delVar, | |||
$ | joinVar, | |||
$ | conds, | |||
$ | fname = 'DatabasePostgres::deleteJoin' | |||
) |
DELETE where the condition is a join MySQL does this with a multi-table DELETE syntax, PostgreSQL does it with sub-selects.
For safety, an empty $conds will not delete everything. If you want to delete all rows where the join condition matches, set $conds='*'
DO NOT put the join condition in $conds
$delTable | String: The table to delete from. | |
$joinTable | String: The other table. | |
$delVar | String: The variable to join on, in the first table. | |
$joinVar | String: The variable to join on, in the second table. | |
$conds | Array: Condition array of field names mapped to variables, ANDed together in the WHERE clause | |
$fname | String: Calling function name (use __METHOD__) for logs/profiling |
Reimplemented from Database.
Definition at line 978 of file DatabasePostgres.php.
References $conds, $fname, $sql, Database::makeList(), Database::query(), and tableName().
DatabasePostgres::doQuery | ( | $ | sql | ) |
The DBMS-dependent part of query().
$sql | String: SQL query. |
Reimplemented from Database.
Definition at line 576 of file DatabasePostgres.php.
References $sql.
Referenced by hasConstraint(), initial_setup(), open(), setup_database(), and setup_plpgsql().
DatabasePostgres::encodeBlob | ( | $ | b | ) |
DatabasePostgres::estimateRowCount | ( | $ | table, | |
$ | vars = '*' , |
|||
$ | conds = '' , |
|||
$ | fname = 'DatabasePostgres::estimateRowCount' , |
|||
$ | 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().
Reimplemented from Database.
Definition at line 692 of file DatabasePostgres.php.
References $conds, $count, $fname, $options, $res, $row, $rows, fetchRow(), freeResult(), and Database::select().
DatabasePostgres::fetchObject | ( | $ | res | ) |
Fetch the next row from the given result object, in object form.
Fields can be retrieved with $row->fieldname, with fields acting like member variables.
$res | SQL result object as returned from Database::query(), etc. |
DBUnexpectedError | Thrown if the database returns an error |
Reimplemented from Database.
Definition at line 598 of file DatabasePostgres.php.
Referenced by indexInfo(), indexUnique(), and textFieldSize().
DatabasePostgres::fetchRow | ( | $ | res | ) |
Fetch the next row from the given result object, in associative array form.
Fields are retrieved with $row['fieldname'].
$res | SQL result object as returned from Database::query(), etc. |
DBUnexpectedError | Thrown if the database returns an error |
Reimplemented from Database.
Definition at line 614 of file DatabasePostgres.php.
Referenced by currentSequenceValue(), estimateRowCount(), and nextSequenceValue().
DatabasePostgres::fieldExists | ( | $ | table, | |
$ | field, | |||
$ | fname = 'DatabasePostgres::fieldExists' | |||
) |
Query whether a given column exists in the mediawiki schema.
Reimplemented from Database.
Definition at line 1192 of file DatabasePostgres.php.
References $count, $fname, $res, $wgDBmwschema, freeResult(), and Database::query().
DatabasePostgres::fieldInfo | ( | $ | table, | |
$ | field | |||
) |
mysql_fetch_field() wrapper Returns false if the field doesn't exist
$table | ||
$field |
Reimplemented from Database.
Definition at line 1207 of file DatabasePostgres.php.
References PostgresField::fromText().
DatabasePostgres::fieldName | ( | $ | res, | |
$ | n | |||
) |
Get a field name in a result object See documentation for mysql_field_name(): http://www.php.net/mysql_field_name.
$res | Mixed: A SQL result | |
$n | Integer |
Reimplemented from Database.
Definition at line 641 of file DatabasePostgres.php.
DatabasePostgres::fieldType | ( | $ | res, | |
$ | index | |||
) |
pg_field_type() wrapper
Reimplemented from Database.
Definition at line 1214 of file DatabasePostgres.php.
References $res.
DatabasePostgres::freeResult | ( | $ | res | ) |
Free a result object.
$res | Mixed: A SQL result |
Reimplemented from Database.
Definition at line 589 of file DatabasePostgres.php.
References $res.
Referenced by constraintExists(), currentSequenceValue(), estimateRowCount(), fieldExists(), nextSequenceValue(), relationExists(), schemaExists(), textFieldSize(), and triggerExists().
DatabasePostgres::functionalIndexes | ( | ) |
Returns true if this database can use functional indexes.
Reimplemented from Database.
Definition at line 108 of file DatabasePostgres.php.
DatabasePostgres::getDBname | ( | ) |
Get the current DB name.
Reimplemented from Database.
Definition at line 1416 of file DatabasePostgres.php.
DatabasePostgres::getLag | ( | ) |
How lagged is this slave?
Reimplemented from Database.
Definition at line 1408 of file DatabasePostgres.php.
DatabasePostgres::getSearchEngine | ( | ) |
Get search engine class.
All subclasses of this need to implement this if they wish to use searching.
Reimplemented from Database.
Definition at line 1437 of file DatabasePostgres.php.
DatabasePostgres::getServer | ( | ) |
Get the server hostname or IP address.
Reimplemented from Database.
Definition at line 1420 of file DatabasePostgres.php.
DatabasePostgres::getServerVersion | ( | ) |
Reimplemented from Database.
Definition at line 1077 of file DatabasePostgres.php.
Referenced by initial_setup(), insert(), and setup_database().
DatabasePostgres::getSoftwareLink | ( | ) |
Reimplemented from Database.
Definition at line 1070 of file DatabasePostgres.php.
DatabasePostgres::hasConstraint | ( | $ | name | ) |
Definition at line 112 of file DatabasePostgres.php.
References $name, $res, $wgDBmwschema, doQuery(), and numRows().
DatabasePostgres::immediateCommit | ( | $ | fname = 'DatabasePostgres::immediateCommit' |
) |
Commit transaction, if one is open.
Reimplemented from Database.
Definition at line 1225 of file DatabasePostgres.php.
DatabasePostgres::implicitGroupby | ( | ) |
Returns true if this database does an implicit sort when doing GROUP BY.
Reimplemented from Database.
Definition at line 99 of file DatabasePostgres.php.
DatabasePostgres::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.
Reimplemented from Database.
Definition at line 102 of file DatabasePostgres.php.
DatabasePostgres::indexInfo | ( | $ | table, | |
$ | index, | |||
$ | fname = 'DatabasePostgres::indexInfo' | |||
) |
Returns information about an index If errors are explicitly ignored, returns NULL on failure.
Reimplemented from Database.
Definition at line 712 of file DatabasePostgres.php.
References $fname, $res, $row, $sql, fetchObject(), and Database::query().
DatabasePostgres::indexUnique | ( | $ | table, | |
$ | index, | |||
$ | fname = 'DatabasePostgres::indexUnique' | |||
) |
Definition at line 726 of file DatabasePostgres.php.
References $fname, $res, $row, $sql, fetchObject(), Database::indexName(), Database::query(), and strencode().
DatabasePostgres::initial_setup | ( | $ | password, | |
$ | dbName | |||
) |
Definition at line 205 of file DatabasePostgres.php.
References $password, $path, $perms, $res, $result, $rows, $version, $wgDBmwschema, $wgDBname, $wgDBpassword, $wgDBts2schema, $wgDBuser, addQuotes(), doQuery(), getServerVersion(), makeConnectionString(), numRows(), print, quote_ident(), schemaExists(), setup_plpgsql(), and tableExists().
DatabasePostgres::insert | ( | $ | table, | |
$ | args, | |||
$ | fname = 'DatabasePostgres::insert' , |
|||
$ | 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).
$table | String: Name of the table to insert to. | |
$args | Array: Items to insert into the table. | |
$fname | String: Name of the function, for profiling | |
$options | String or Array. Valid options: IGNORE |
Reimplemented from Database.
Definition at line 753 of file DatabasePostgres.php.
References $args, $fname, $ignore, $keys, $options, $res, $row, $sql, begin(), commit(), getServerVersion(), Database::makeList(), Database::query(), and tableName().
DatabasePostgres::insertId | ( | ) |
This must be called after nextSequenceVal.
Reimplemented from Database.
Definition at line 651 of file DatabasePostgres.php.
DatabasePostgres::lastErrno | ( | ) |
Get the last error number See mysql_errno().
Reimplemented from Database.
Definition at line 670 of file DatabasePostgres.php.
Referenced by wasDeadlock().
DatabasePostgres::lastError | ( | ) |
Get a description of the last error See mysql_error() for more details.
Reimplemented from Database.
Definition at line 662 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.
$sql | String: SQL query we will append the limit too | |
$limit | Integer: the SQL limit | |
$offset | Integer the SQL offset (default false) |
Reimplemented from Database.
Definition at line 1016 of file DatabasePostgres.php.
References $offset.
DatabasePostgres::limitResultForUpdate | ( | $ | sql, | |
$ | num | |||
) |
DatabasePostgres::lock | ( | $ | lockName, | |
$ | method | |||
) |
Acquire a lock.
Abstracted from Filestore::lock() so child classes can implement for their own needs.
$lockName | String: Name of lock to aquire | |
$method | String: Name of method calling us |
Reimplemented from Database.
Definition at line 1430 of file DatabasePostgres.php.
DatabasePostgres::lowPriorityOption | ( | ) |
Reimplemented from Database.
Definition at line 1012 of file DatabasePostgres.php.
DatabasePostgres::makeConnectionString | ( | $ | vars | ) |
DatabasePostgres::makeSelectOptions | ( | $ | options | ) |
Various select options.
$options | Array: an associative array of options to be turned into an SQL query, valid keys are listed in the function. |
Reimplemented from Database.
Definition at line 1367 of file DatabasePostgres.php.
static DatabasePostgres::newFromParams | ( | $ | server, | |
$ | user, | |||
$ | password, | |||
$ | dbName, | |||
$ | failFunction = false , |
|||
$ | flags = 0 | |||
) | [static] |
Same as new Database( .
.. ), kept for backward compatibility
$server | String: database server host | |
$user | String: database user name | |
$password | String: database user password | |
$dbName | String: database name | |
failFunction | ||
$flags |
Reimplemented from Database.
Definition at line 118 of file DatabasePostgres.php.
References $flags, $password, $user, and DatabasePostgres().
DatabasePostgres::nextSequenceValue | ( | $ | seqName | ) |
Return the next in a sequence, save the value for retrieval via insertId().
Reimplemented from Database.
Definition at line 891 of file DatabasePostgres.php.
References $res, $row, fetchRow(), freeResult(), and Database::query().
DatabasePostgres::numFields | ( | $ | res | ) |
Get the number of fields in a result object See documentation for mysql_num_fields().
$res | Mixed: A SQL result |
Reimplemented from Database.
Definition at line 635 of file DatabasePostgres.php.
References $res.
DatabasePostgres::numRows | ( | $ | res | ) |
Get the number of rows in a result object.
$res | Mixed: A SQL result |
Reimplemented from Database.
Definition at line 625 of file DatabasePostgres.php.
Referenced by hasConstraint(), initial_setup(), and setup_plpgsql().
DatabasePostgres::open | ( | $ | server, | |
$ | user, | |||
$ | password, | |||
$ | dbName | |||
) |
Usually aborts on failure If the failFunction is set to a non-zero integer, returns success.
Reimplemented from Database.
Definition at line 127 of file DatabasePostgres.php.
References $password, $user, $wgCommandLineMode, $wgDBmwschema, $wgDBport, $wgDBts2schema, close(), doQuery(), Database::installErrorHandler(), is(), lastError(), makeConnectionString(), quote_ident(), Database::restoreErrorHandler(), and wfDebug().
Referenced by DatabasePostgres().
DatabasePostgres::ping | ( | ) |
Ping the server and try to reconnect if it there is no connection.
Reimplemented from Database.
Definition at line 1399 of file DatabasePostgres.php.
References wfDebug().
DatabasePostgres::queryIgnore | ( | $ | sql, | |
$ | fname = '' | |||
) |
Definition at line 585 of file DatabasePostgres.php.
References $fname, $sql, and Database::query().
DatabasePostgres::quote_ident | ( | $ | s | ) |
Definition at line 1323 of file DatabasePostgres.php.
References $s.
Referenced by initial_setup(), open(), and setup_database().
DatabasePostgres::realTimestamps | ( | ) |
Returns true if this database uses timestamps rather than integers.
Reimplemented from Database.
Definition at line 96 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).
Definition at line 1096 of file DatabasePostgres.php.
References $count, $res, $wgDBmwschema, addQuotes(), freeResult(), and Database::query().
Referenced by sequenceExists(), and tableExists().
DatabasePostgres::replace | ( | $ | table, | |
$ | uniqueIndexes, | |||
$ | rows, | |||
$ | fname = 'DatabasePostgres::replace' | |||
) |
REPLACE query wrapper PostgreSQL simulates this with a DELETE followed by INSERT $row is the row to insert, an associative array $uniqueIndexes is an array of indexes.
Each element may be either a field name or an array of field names
It may be more efficient to leave off unique indexes which are unlikely to collide. However if you do this, you run the risk of encountering errors which wouldn't have occurred in MySQL
Reimplemented from Database.
Definition at line 928 of file DatabasePostgres.php.
References $fname, $row, $rows, $sql, addQuotes(), Database::makeList(), Database::query(), and tableName().
DatabasePostgres::replaceVars | ( | $ | ins | ) | [protected] |
Postgres specific version of replaceVars.
Calls the parent version in Database.php
$ins | String: SQL string, read from a stream (usually tables.sql) |
Reimplemented from Database.
Definition at line 1342 of file DatabasePostgres.php.
DatabasePostgres::reportQueryError | ( | $ | error, | |
$ | errno, | |||
$ | sql, | |||
$ | fname, | |||
$ | tempIgnore = false | |||
) |
$error | String | |
$errno | Integer | |
$sql | String | |
$fname | String | |
$tempIgnore | Boolean |
Reimplemented from Database.
Definition at line 1049 of file DatabasePostgres.php.
References $ignore, Database::ignoreErrors(), and wfDebug().
DatabasePostgres::ruleExists | ( | $ | table, | |
$ | rule | |||
) |
Definition at line 1146 of file DatabasePostgres.php.
References $wgDBmwschema, and Database::selectField().
DatabasePostgres::schemaExists | ( | $ | schema | ) |
Query whether a given schema exists.
Returns the name of the owner
Definition at line 1173 of file DatabasePostgres.php.
References $res, $row, freeResult(), and Database::query().
Referenced by initial_setup().
DatabasePostgres::searchableIPs | ( | ) |
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 Database.
Definition at line 105 of file DatabasePostgres.php.
DatabasePostgres::selectDB | ( | $ | db | ) |
Change the current database.
Reimplemented from Database.
Definition at line 1328 of file DatabasePostgres.php.
DatabasePostgres::sequenceExists | ( | $ | sequence, | |
$ | schema = false | |||
) |
DatabasePostgres::setFakeMaster | ( | $ | enabled = true |
) |
Make this connection a fake master.
Reimplemented from Database.
Definition at line 1414 of file DatabasePostgres.php.
DatabasePostgres::setFakeSlaveLag | ( | $ | lag | ) |
Set lag time in seconds for a fake slave.
Reimplemented from Database.
Definition at line 1413 of file DatabasePostgres.php.
DatabasePostgres::setTimeout | ( | $ | timeout | ) |
Override database's default connection timeout.
May be useful for very long batch queries such as full-wiki dumps, where a single query reads out over hours or days.
$timeout | Integer in seconds |
Reimplemented from Database.
Definition at line 1395 of file DatabasePostgres.php.
DatabasePostgres::setup_database | ( | ) |
Definition at line 1238 of file DatabasePostgres.php.
References $res, $wgDBmwschema, $wgDBport, $wgDBts2schema, $wgDBuser, $wgVersion, addQuotes(), dbsource(), doQuery(), getServerVersion(), print, Database::query(), quote_ident(), and tableExists().
DatabasePostgres::setup_plpgsql | ( | ) |
Definition at line 532 of file DatabasePostgres.php.
References $result, $rows, $wgDBname, doQuery(), numRows(), and print.
Referenced by initial_setup().
DatabasePostgres::strencode | ( | $ | s | ) |
Wrapper for addslashes().
$s | String: to be slashed. |
Reimplemented from Database.
Definition at line 1308 of file DatabasePostgres.php.
References $s.
Referenced by indexUnique().
DatabasePostgres::strictIPs | ( | ) |
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 Database.
Definition at line 93 of file DatabasePostgres.php.
DatabasePostgres::tableExists | ( | $ | table, | |
$ | schema = false | |||
) |
Definition at line 1118 of file DatabasePostgres.php.
References relationExists().
Referenced by initial_setup(), and setup_database().
DatabasePostgres::tableName | ( | $ | name | ) |
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.
$name | String: database table name |
Reimplemented from Database.
Definition at line 876 of file DatabasePostgres.php.
References $name.
Referenced by deleteJoin(), insert(), replace(), and textFieldSize().
DatabasePostgres::textFieldSize | ( | $ | table, | |
$ | field | |||
) |
Returns the size of a text field, or -1 for "unlimited".
Reimplemented from Database.
Definition at line 995 of file DatabasePostgres.php.
References $res, $row, $size, $sql, fetchObject(), freeResult(), Database::query(), and tableName().
DatabasePostgres::timestamp | ( | $ | ts = 0 |
) |
Return MW-style timestamp used for MySQL schema.
Reimplemented from Database.
Definition at line 1037 of file DatabasePostgres.php.
References $ts, and wfTimestamp().
DatabasePostgres::triggerExists | ( | $ | table, | |
$ | trigger | |||
) |
Definition at line 1126 of file DatabasePostgres.php.
References $res, $rows, $wgDBmwschema, addQuotes(), END, freeResult(), and Database::query().
DatabasePostgres::unlock | ( | $ | lockName, | |
$ | method | |||
) |
Release a lock.
$lockName | String: Name of lock to release | |
$method | String: Name of method calling us |
Reimplemented from Database.
Definition at line 1433 of file DatabasePostgres.php.
DatabasePostgres::useIndexClause | ( | $ | index | ) |
Postgres does not have a "USE INDEX" clause, so return an empty string.
Reimplemented from Database.
Definition at line 915 of file DatabasePostgres.php.
DatabasePostgres::wasDeadlock | ( | ) |
Determines if the last failure was due to a deadlock.
Reimplemented from Database.
Definition at line 1033 of file DatabasePostgres.php.
References lastErrno().
DatabasePostgres::$mAffectedRows = NULL |
Definition at line 75 of file DatabasePostgres.php.
DatabasePostgres::$mInsertId = NULL |
Definition at line 72 of file DatabasePostgres.php.
DatabasePostgres::$mLastResult = NULL |
Definition at line 73 of file DatabasePostgres.php.
DatabasePostgres::$numeric_version = NULL |
Definition at line 74 of file DatabasePostgres.php.