MediaWiki
REL1_24
|
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) | |
Posted by cc[plus]php[at]c2se[dot]com on 25-Mar-2009 09:12 to http://www.php.net/manual/en/ref.pgsql.php. | |
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 291 of file DatabasePostgres.php.
DatabasePostgres::addQuotes | ( | $ | s | ) |
null | bool | Blob | $s |
Reimplemented from DatabaseBase.
Definition at line 1507 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 669 of file DatabasePostgres.php.
DatabasePostgres::aggregateValue | ( | $ | valuedata, |
$ | valuename = 'value' |
||
) |
Return aggregated value function call.
array | $valuedata | |
string | $valuename |
Reimplemented from DatabaseBase.
Definition at line 1200 of file DatabasePostgres.php.
DatabasePostgres::bigintFromLockName | ( | $ | lockName | ) | [private] |
string | $lockName |
Definition at line 1681 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 1591 of file DatabasePostgres.php.
DatabasePostgres::buildGroupConcatField | ( | $ | delimiter, |
$ | table, | ||
$ | field, | ||
$ | conds = '' , |
||
$ | options = array() , |
||
$ | join_conds = array() |
||
) |
Definition at line 1595 of file DatabasePostgres.php.
Returns true if this database supports (and uses) cascading deletes.
Reimplemented from DatabaseBase.
Definition at line 310 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 314 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 471 of file DatabasePostgres.php.
DatabasePostgres::constraintExists | ( | $ | table, |
$ | constraint | ||
) |
Definition at line 1425 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 1086 of file DatabasePostgres.php.
DatabasePostgres::dataSeek | ( | $ | res, |
$ | row | ||
) |
mixed | $res | |
int | $row |
Implements DatabaseType.
Definition at line 641 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 1491 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 1288 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 475 of file DatabasePostgres.php.
Referenced by open().
DatabasePostgres::dumpError | ( | ) | [protected] |
Definition at line 493 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 1121 of file DatabasePostgres.php.
DatabasePostgres::encodeBlob | ( | $ | b | ) |
string | $b |
Reimplemented from DatabaseBase.
Definition at line 1487 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 695 of file DatabasePostgres.php.
DatabasePostgres::fetchObject | ( | $ | res | ) |
ResultWrapper | stdClass | $res |
DBUnexpectedError |
Implements DatabaseType.
Definition at line 555 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 576 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 1465 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 618 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 1475 of file DatabasePostgres.php.
References PostgresField\fromText().
DatabasePostgres::freeResult | ( | $ | res | ) |
stdClass | ResultWrapper | $res |
DBUnexpectedError |
Reimplemented from DatabaseBase.
Definition at line 538 of file DatabasePostgres.php.
Returns true if this database can use functional indexes.
Reimplemented from DatabaseBase.
Definition at line 338 of file DatabasePostgres.php.
Return schema name fore core MediaWiki tables.
Definition at line 1322 of file DatabasePostgres.php.
Return current schema (executes SELECT current_schema()) Needs transaction.
Definition at line 1218 of file DatabasePostgres.php.
Get the current DB name.
Reimplemented from DatabaseBase.
Definition at line 1583 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 1235 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 1603 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 1254 of file DatabasePostgres.php.
References $res, fetchRow(), and DatabaseBase\query().
Get the server hostname or IP address.
Reimplemented from DatabaseBase.
Definition at line 1587 of file DatabasePostgres.php.
Implements DatabaseType.
Definition at line 1329 of file DatabasePostgres.php.
Referenced by open().
Implements DatabaseType.
Definition at line 1207 of file DatabasePostgres.php.
Get the type of the DBMS, as it appears in $wgDBtype.
Implements DatabaseType.
Definition at line 306 of file DatabasePostgres.php.
DatabasePostgres::hasConstraint | ( | $ | name | ) |
Definition at line 342 of file DatabasePostgres.php.
Returns true if this database does an implicit sort when doing GROUP BY.
Reimplemented from DatabaseBase.
Definition at line 326 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 330 of file DatabasePostgres.php.
DatabasePostgres::indexAttributes | ( | $ | index, |
$ | schema = false |
||
) |
Returns is of attributes used in index.
string | $index | |
bool | string | $schema |
Definition at line 744 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 721 of file DatabasePostgres.php.
References $fname, $res, as, and DatabaseBase\query().
DatabasePostgres::indexUnique | ( | $ | table, |
$ | index, | ||
$ | fname = __METHOD__ |
||
) |
Definition at line 801 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 860 of file DatabasePostgres.php.
Return the result of the last call to nextSequenceValue(); This must be called after nextSequenceValue().
Implements DatabaseType.
Definition at line 632 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 986 of file DatabasePostgres.php.
Get the last error number.
Implements DatabaseType.
Definition at line 661 of file DatabasePostgres.php.
Get a description of the last error.
Implements DatabaseType.
Definition at line 649 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 1113 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 1129 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 1645 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 1629 of file DatabasePostgres.php.
References $key, $result, addQuotes(), bigintFromLockName(), fetchObject(), and DatabaseBase\query().
DatabasePostgres::makeConnectionString | ( | $ | vars | ) |
Definition at line 457 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 1548 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 1071 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 610 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 593 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 361 of file DatabasePostgres.php.
References $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 |
||
) |
Posted by cc[plus]php[at]c2se[dot]com on 25-Mar-2009 09:12 to http://www.php.net/manual/en/ref.pgsql.php.
Parsing a postgres array can be a tricky problem, he's my take on this, it handles multi-dimensional arrays plus escaping using a nasty regexp to determine the limits of each data-item.
This should really be handled by PHP PostgreSQL module
string | $text | Postgreql array returned in a text form like {a,b} |
string | $output | |
int | $limit | |
int | $offset |
Definition at line 1167 of file DatabasePostgres.php.
DatabasePostgres::queryIgnore | ( | $ | sql, |
$ | fname = __METHOD__ |
||
) |
Definition at line 530 of file DatabasePostgres.php.
DatabasePostgres::realTableName | ( | $ | name, |
$ | format = 'quoted' |
||
) |
Definition at line 1061 of file DatabasePostgres.php.
Returns true if this database uses timestamps rather than integers.
Reimplemented from DatabaseBase.
Definition at line 322 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 1355 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 1526 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 514 of file DatabasePostgres.php.
DatabasePostgres::roleExists | ( | $ | roleName | ) |
Returns true if a given role (i.e.
user) exists, false otherwise.
string | $roleName |
Definition at line 1458 of file DatabasePostgres.php.
DatabasePostgres::ruleExists | ( | $ | table, |
$ | rule | ||
) |
Definition at line 1413 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 1446 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 334 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 449 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 825 of file DatabasePostgres.php.
Referenced by streamStatementEnd().
DatabasePostgres::sequenceExists | ( | $ | sequence, |
$ | schema = false |
||
) |
Definition at line 1386 of file DatabasePostgres.php.
DatabasePostgres::setSearchPath | ( | $ | search_path | ) |
Update search_path, values should already be sanitized Values may contain magic keywords like "$user".
array | $search_path | List of schemas to be searched by default |
Definition at line 1270 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 1607 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 1499 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 318 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 1382 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 1048 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 1096 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 1145 of file DatabasePostgres.php.
DatabasePostgres::triggerExists | ( | $ | table, |
$ | trigger | ||
) |
Definition at line 1390 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 1669 of file DatabasePostgres.php.
Determines if the last failure was due to a deadlock STUB.
Reimplemented from DatabaseBase.
Definition at line 1117 of file DatabasePostgres.php.
string DatabasePostgres::$connectString [private] |
Connect string to open a PostgreSQL connection *.
Definition at line 300 of file DatabasePostgres.php.
int DatabasePostgres::$mAffectedRows = null [protected] |
The number of rows affected as an integer *.
Definition at line 294 of file DatabasePostgres.php.
string DatabasePostgres::$mCoreSchema [private] |
*
Definition at line 304 of file DatabasePostgres.php.
int DatabasePostgres::$mInsertId = null [private] |
*
Definition at line 296 of file DatabasePostgres.php.
resource DatabasePostgres::$mLastResult = null [protected] |
*
Definition at line 292 of file DatabasePostgres.php.
PostgresTransactionState DatabasePostgres::$mTransactionState [private] |
*
Definition at line 302 of file DatabasePostgres.php.
float string DatabasePostgres::$numericVersion = null [private] |
*
Definition at line 298 of file DatabasePostgres.php.