MediaWiki
master
|
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. | |
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) | |
Change the position of the cursor in a result object. | |
decodeBlob ($b) | |
Some DBMSs return a special placeholder object representing blob fields in result objects. | |
determineCoreSchema ($desired_schema) | |
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= 'DatabasePostgres::duplicateTableStructure') | |
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= '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() | |
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. | |
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) | |
Free a result object returned by query() or select(). | |
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 () | |
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= '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. | |
insertId () | |
This must be called after nextSequenceVal. | |
insertSelect ($destTable, $srcTable, $varMap, $conds, $fname= 'DatabasePostgres::insertSelect', $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= 'DatabasePostgres::listTables') | |
List all tables on the database. | |
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= 'DatabasePostgres::queryIgnore') | |
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. | |
sequenceExists ($sequence, $schema=false) | |
setFakeMaster ($enabled=true) | |
Make this connection a fake master. | |
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) | |
wasDeadlock () | |
Determines if the last failure was due to a deadlock STUB. | |
Static Public Member Functions | |
static | getSoftwareLink () |
Public Attributes | |
$mAffectedRows = null | |
$mInsertId = null | |
$mLastResult = null | |
$numeric_version = null | |
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. |
Definition at line 284 of file DatabasePostgres.php.
DatabasePostgres::addQuotes | ( | $ | s | ) |
$s | null|bool|Blob |
Reimplemented from DatabaseBase.
Definition at line 1331 of file DatabasePostgres.php.
References $s.
Referenced by constraintExists(), listTables(), relationExists(), and triggerExists().
Get the number of rows affected by the last write query.
Implements DatabaseType.
Definition at line 588 of file DatabasePostgres.php.
References empty.
DatabasePostgres::aggregateValue | ( | $ | valuedata, |
$ | valuename = 'value' |
||
) |
Return aggregated value function call.
Reimplemented from DatabaseBase.
Definition at line 1049 of file DatabasePostgres.php.
DatabasePostgres::buildConcat | ( | $ | stringList | ) |
Build a concatenation list to feed into a SQL query.
$stringList | Array: list of raw SQL expressions; caller is responsible for any quoting |
Reimplemented from DatabaseBase.
Definition at line 1431 of file DatabasePostgres.php.
Returns true if this database supports (and uses) cascading deletes.
Reimplemented from DatabaseBase.
Definition at line 294 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 297 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 427 of file DatabasePostgres.php.
DatabasePostgres::constraintExists | ( | $ | table, |
$ | constraint | ||
) |
Definition at line 1258 of file DatabasePostgres.php.
References $res, addQuotes(), getCoreSchema(), and DatabaseBase\query().
DatabasePostgres::currentSequenceValue | ( | $ | seqName | ) |
Return the current value of a sequence.
Assumes it has been nextval'ed in this session.
Definition at line 943 of file DatabasePostgres.php.
References $res, fetchRow(), and DatabaseBase\query().
DatabasePostgres::dataSeek | ( | $ | res, |
$ | row | ||
) |
Change the position of the cursor in a result object.
$res | Mixed: A SQL result |
$row | Mixed: Either MySQL row or ResultWrapper |
Implements DatabaseType.
Definition at line 562 of file DatabasePostgres.php.
References $res.
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.
$b | string |
Reimplemented from DatabaseBase.
Definition at line 1316 of file DatabasePostgres.php.
DatabasePostgres::determineCoreSchema | ( | $ | desired_schema | ) |
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
$desired_schema | string |
Definition at line 1132 of file DatabasePostgres.php.
References DatabaseBase\addIdentifierQuotes(), DatabaseBase\begin(), DatabaseBase\commit(), getCurrentSchema(), getSchemas(), getSearchPath(), schemaExists(), setSearchPath(), and wfDebug().
Referenced by open().
DatabasePostgres::doQuery | ( | $ | sql | ) |
The DBMS-dependent part of query()
$sql | String: SQL query. |
Reimplemented from DatabaseBase.
Definition at line 431 of file DatabasePostgres.php.
Referenced by hasConstraint(), and open().
DatabasePostgres::dumpError | ( | ) | [protected] |
Definition at line 448 of file DatabasePostgres.php.
DatabasePostgres::duplicateTableStructure | ( | $ | oldName, |
$ | newName, | ||
$ | temporary = false , |
||
$ | fname = 'DatabasePostgres::duplicateTableStructure' |
||
) |
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).
$oldName | String: name of table whose structure should be copied |
$newName | String: name of table to be created |
$temporary | Boolean: whether the new table should be temporary |
$fname | String: calling function name |
MWException |
Reimplemented from DatabaseBase.
Definition at line 976 of file DatabasePostgres.php.
References $fname, DatabaseBase\addIdentifierQuotes(), and DatabaseBase\query().
DatabasePostgres::encodeBlob | ( | $ | b | ) |
$b |
Reimplemented from DatabaseBase.
Definition at line 1312 of file DatabasePostgres.php.
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 DatabaseBase.
Definition at line 607 of file DatabasePostgres.php.
References $count, $fname, $options, $res, $vars, array(), fetchRow(), and DatabaseBase\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 | ResultWrapper|object as returned from DatabaseBase::query(), etc. |
DBUnexpectedError | Thrown if the database returns an error |
Implements DatabaseType.
Definition at line 497 of file DatabasePostgres.php.
References $res, wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by textFieldSize().
DatabasePostgres::fetchRow | ( | $ | res | ) |
Fetch the next row from the given result object, in associative array form.
Fields are retrieved with $row['fieldname'].
$res | ResultWrapper result object as returned from DatabaseBase::query(), etc. |
DBUnexpectedError | Thrown if the database returns an error |
Implements DatabaseType.
Definition at line 514 of file DatabasePostgres.php.
References $res, wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by currentSequenceValue(), estimateRowCount(), getCurrentSchema(), getSchemas(), getSearchPath(), and nextSequenceValue().
DatabasePostgres::fieldInfo | ( | $ | table, |
$ | field | ||
) |
mysql_fetch_field() wrapper Returns false if the field doesn't exist
$table | string: table name |
$field | string: field name |
Implements DatabaseType.
Definition at line 1293 of file DatabasePostgres.php.
References PostgresField\fromText().
DatabasePostgres::fieldName | ( | $ | res, |
$ | n | ||
) |
Get a field name in a result object.
$res | Mixed: A SQL result |
$n | Integer |
Implements DatabaseType.
Definition at line 547 of file DatabasePostgres.php.
DatabasePostgres::fieldType | ( | $ | res, |
$ | index | ||
) |
pg_field_type() wrapper
Reimplemented from DatabaseBase.
Definition at line 1301 of file DatabasePostgres.php.
References $res.
DatabasePostgres::freeResult | ( | $ | res | ) |
Free a result object returned by query() or select().
It's usually not necessary to call this, just use unset() or let the variable holding the result object go out of scope.
$res | Mixed: A SQL result |
Reimplemented from DatabaseBase.
Definition at line 485 of file DatabasePostgres.php.
References $ok, $res, wfRestoreWarnings(), and wfSuppressWarnings().
Returns true if this database can use functional indexes.
Reimplemented from DatabaseBase.
Definition at line 315 of file DatabasePostgres.php.
Return schema name fore core MediaWiki tables.
Definition at line 1165 of file DatabasePostgres.php.
Referenced by constraintExists(), hasConstraint(), indexAttributes(), listTables(), relationExists(), ruleExists(), and triggerExists().
Return current schema (executes SELECT current_schema()) Needs transaction.
Definition at line 1068 of file DatabasePostgres.php.
References $res, fetchRow(), and DatabaseBase\query().
Referenced by determineCoreSchema().
Get the current DB name.
Reimplemented from DatabaseBase.
Definition at line 1423 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.
getSearchPath() setSearchPath()
Definition at line 1084 of file DatabasePostgres.php.
References $res, array(), fetchRow(), pg_array_parse(), and DatabaseBase\query().
Referenced by determineCoreSchema().
Get search engine class.
All subclasses of this need to implement this if they wish to use searching.
Reimplemented from DatabaseBase.
Definition at line 1435 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 1101 of file DatabasePostgres.php.
References $res, fetchRow(), and DatabaseBase\query().
Referenced by determineCoreSchema().
Get the server hostname or IP address.
Reimplemented from DatabaseBase.
Definition at line 1427 of file DatabasePostgres.php.
Implements DatabaseType.
Definition at line 1172 of file DatabasePostgres.php.
Referenced by insert().
static DatabasePostgres::getSoftwareLink | ( | ) | [static] |
Implements DatabaseType.
Definition at line 1056 of file DatabasePostgres.php.
Get the type of the DBMS, as it appears in $wgDBtype.
Implements DatabaseType.
Definition at line 290 of file DatabasePostgres.php.
DatabasePostgres::hasConstraint | ( | $ | name | ) |
Definition at line 319 of file DatabasePostgres.php.
References $name, $res, doQuery(), getCoreSchema(), and numRows().
Returns true if this database does an implicit sort when doing GROUP BY.
Reimplemented from DatabaseBase.
Definition at line 306 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 309 of file DatabasePostgres.php.
DatabasePostgres::indexAttributes | ( | $ | index, |
$ | schema = false |
||
) |
Returns is of attributes used in index.
Definition at line 646 of file DatabasePostgres.php.
References $res, array(), as, getCoreSchema(), n, and DatabaseBase\query().
DatabasePostgres::indexInfo | ( | $ | table, |
$ | index, | ||
$ | fname = 'DatabasePostgres::indexInfo' |
||
) |
Returns information about an index If errors are explicitly ignored, returns NULL on failure.
Implements DatabaseType.
Definition at line 626 of file DatabasePostgres.php.
References $fname, $res, as, and DatabaseBase\query().
DatabasePostgres::indexUnique | ( | $ | table, |
$ | index, | ||
$ | fname = 'DatabasePostgres::indexUnique' |
||
) |
Definition at line 702 of file DatabasePostgres.php.
References $fname, $res, as, DatabaseBase\indexName(), DatabaseBase\query(), and strencode().
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 DatabaseBase.
Definition at line 730 of file DatabasePostgres.php.
References $fname, $keys, $options, $res, array(), as, getServerVersion(), DatabaseBase\makeList(), DatabaseBase\query(), and tableName().
This must be called after nextSequenceVal.
Implements DatabaseType.
Definition at line 558 of file DatabasePostgres.php.
DatabasePostgres::insertSelect | ( | $ | destTable, |
$ | srcTable, | ||
$ | varMap, | ||
$ | conds, | ||
$ | fname = 'DatabasePostgres::insertSelect' , |
||
$ | 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.
Reimplemented from DatabaseBase.
Definition at line 847 of file DatabasePostgres.php.
References $fname, $res, array(), list, DatabaseBase\makeList(), makeSelectOptions(), DatabaseBase\query(), and tableName().
Get the last error number.
Implements DatabaseType.
Definition at line 580 of file DatabasePostgres.php.
Referenced by wasDeadlock().
Get a description of the last error.
Implements DatabaseType.
Definition at line 569 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.
$sql | String SQL query we will append the limit too |
$limit | Integer the SQL limit |
$offset | Integer|bool the SQL offset (default false) |
DBUnexpectedError |
Reimplemented from DatabaseBase.
Definition at line 968 of file DatabasePostgres.php.
DatabasePostgres::listTables | ( | $ | prefix = null , |
$ | fname = 'DatabasePostgres::listTables' |
||
) |
List all tables on the database.
$prefix | string Only show tables with this prefix, e.g. mw_ |
$fname | String: calling function name |
MWException |
Reimplemented from DatabaseBase.
Definition at line 982 of file DatabasePostgres.php.
References $fname, $result, $vars, addQuotes(), array(), as, getCoreSchema(), and DatabaseBase\query().
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 DatabaseBase.
Definition at line 1376 of file DatabasePostgres.php.
References $options, array(), and as.
Referenced by insertSelect().
DatabasePostgres::nextSequenceValue | ( | $ | seqName | ) |
Return the next in a sequence, save the value for retrieval via insertId()
Reimplemented from DatabaseBase.
Definition at line 931 of file DatabasePostgres.php.
References $res, fetchRow(), and DatabaseBase\query().
DatabasePostgres::numFields | ( | $ | res | ) |
Get the number of fields in a result object.
$res | Mixed: A SQL result |
Implements DatabaseType.
Definition at line 540 of file DatabasePostgres.php.
References $res.
DatabasePostgres::numRows | ( | $ | res | ) |
Get the number of rows in a result object.
$res | Mixed: A SQL result |
Implements DatabaseType.
Definition at line 527 of file DatabasePostgres.php.
References $n, $res, wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by hasConstraint().
DatabasePostgres::open | ( | $ | server, |
$ | user, | ||
$ | password, | ||
$ | dbName | ||
) |
Usually aborts on failure.
string | $server | |
string | $user | |
string | $password | |
string | $dbName |
DBConnectionError |
Implements DatabaseType.
Definition at line 335 of file DatabasePostgres.php.
References $password, $user, $wgCommandLineMode, array(), DatabaseBase\close(), determineCoreSchema(), doQuery(), e, global, DatabaseBase\installErrorHandler(), is, lastError(), makeConnectionString(), DatabaseBase\query(), DatabaseBase\restoreErrorHandler(), and wfDebug().
Referenced by selectDB().
DatabasePostgres::pg_array_parse | ( | $ | text, |
&$ | output, | ||
$ | limit = false , |
||
$ | offset = 1 |
||
) |
Definition at line 1020 of file DatabasePostgres.php.
References $limit, $output, and array().
Referenced by getSchemas().
DatabasePostgres::queryIgnore | ( | $ | sql, |
$ | fname = 'DatabasePostgres::queryIgnore' |
||
) |
Definition at line 481 of file DatabasePostgres.php.
References $fname, and DatabaseBase\query().
DatabasePostgres::realTableName | ( | $ | name, |
$ | format = 'quoted' |
||
) |
Definition at line 923 of file DatabasePostgres.php.
References $name, and tableName().
Referenced by relationExists(), and tableName().
Returns true if this database uses timestamps rather than integers.
Reimplemented from DatabaseBase.
Definition at line 303 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 1194 of file DatabasePostgres.php.
References $count, $res, addQuotes(), array(), getCoreSchema(), DatabaseBase\query(), and realTableName().
Referenced by sequenceExists(), and tableExists().
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 DatabaseBase.
Definition at line 1352 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.
$error | String |
$errno | Integer |
$sql | String |
$fname | String |
$tempIgnore | Boolean |
DBQueryError |
Reimplemented from DatabaseBase.
Definition at line 466 of file DatabasePostgres.php.
References $error, $fname, and DatabaseBase\rollback().
DatabasePostgres::roleExists | ( | $ | roleName | ) |
Returns true if a given role (i.e.
user) exists, false otherwise.
Definition at line 1287 of file DatabasePostgres.php.
References array(), and DatabaseBase\selectField().
DatabasePostgres::ruleExists | ( | $ | table, |
$ | rule | ||
) |
Definition at line 1247 of file DatabasePostgres.php.
References array(), getCoreSchema(), and DatabaseBase\selectField().
DatabasePostgres::schemaExists | ( | $ | schema | ) |
Query whether a given schema exists.
Returns true if it does, false if it doesn't.
Definition at line 1277 of file DatabasePostgres.php.
References array(), and DatabaseBase\selectField().
Referenced by determineCoreSchema().
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 312 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
Reimplemented from DatabaseBase.
Definition at line 406 of file DatabasePostgres.php.
References open().
DatabasePostgres::sequenceExists | ( | $ | sequence, |
$ | schema = false |
||
) |
Definition at line 1221 of file DatabasePostgres.php.
References relationExists().
DatabasePostgres::setFakeMaster | ( | $ | enabled = true | ) |
Make this connection a fake master.
$enabled | bool |
Reimplemented from DatabaseBase.
Definition at line 1421 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 1115 of file DatabasePostgres.php.
References DatabaseBase\query().
Referenced by determineCoreSchema().
DatabasePostgres::streamStatementEnd | ( | &$ | sql, |
&$ | newLine | ||
) |
Called by sourceStream() to check if we've reached a statement end.
$sql | String SQL assembled so far |
$newLine | String New line about to be added to $sql |
Reimplemented from DatabaseBase.
Definition at line 1439 of file DatabasePostgres.php.
DatabasePostgres::strencode | ( | $ | s | ) |
Wrapper for addslashes()
$s | string: to be slashed. |
Implements DatabaseType.
Definition at line 1323 of file DatabasePostgres.php.
References $s.
Referenced by indexUnique().
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 300 of file DatabasePostgres.php.
DatabasePostgres::tableExists | ( | $ | table, |
$ | fname = __METHOD__ , |
||
$ | schema = false |
||
) |
For backward compatibility, this function checks both tables and views.
Definition at line 1217 of file DatabasePostgres.php.
References array(), and relationExists().
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.
$name | String: database table name |
$format | String 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 910 of file DatabasePostgres.php.
References $name, and realTableName().
Referenced by insert(), insertSelect(), realTableName(), and textFieldSize().
DatabasePostgres::textFieldSize | ( | $ | table, |
$ | field | ||
) |
Returns the size of a text field, or -1 for "unlimited".
$table | string |
$field | string |
Reimplemented from DatabaseBase.
Definition at line 952 of file DatabasePostgres.php.
References $res, $size, fetchObject(), DatabaseBase\query(), and tableName().
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.
$ts | string|int |
Reimplemented from DatabaseBase.
Definition at line 998 of file DatabasePostgres.php.
References wfTimestamp().
DatabasePostgres::triggerExists | ( | $ | table, |
$ | trigger | ||
) |
Definition at line 1225 of file DatabasePostgres.php.
References $res, addQuotes(), getCoreSchema(), and DatabaseBase\query().
Determines if the last failure was due to a deadlock STUB.
Reimplemented from DatabaseBase.
Definition at line 972 of file DatabasePostgres.php.
References lastErrno().
DatabasePostgres::$mAffectedRows = null |
Definition at line 288 of file DatabasePostgres.php.
DatabasePostgres::$mInsertId = null |
Definition at line 285 of file DatabasePostgres.php.
DatabasePostgres::$mLastResult = null |
Definition at line 286 of file DatabasePostgres.php.
DatabasePostgres::$numeric_version = null |
Definition at line 287 of file DatabasePostgres.php.