Test to see if the PostgreSQL connector is available.
static boolean
isSupported
()
Test to see if the PostgreSQL connector is available
static boolean
test
()
Redefinition of:
- JDatabase::test()
- Test to see if the connector is available.
Database object constructor
JDatabaseDriverPostgresql
__construct
(array $options)
-
array
$options: List of options used to configure the connection
Redefinition of:
- JDatabaseDriver::__construct()
- Constructor.
Database object destructor
void
__destruct
()
Connects to the database if needed.
void
connect
()
Redefinition of:
- JDatabaseDriver::connect()
- Connects to the database if needed.
Determines if the connection to the server is active.
boolean
connected
()
Redefinition of:
- JDatabaseDriver::connected()
- Determines if the connection to the server is active.
Drops a table from the database.
boolean
dropTable
(string $tableName, [boolean $ifExists = true])
-
string
$tableName: The name of the database table to drop.
-
boolean
$ifExists: Optionally specify that the table must exist before it is dropped.
Redefinition of:
- JDatabaseDriver::dropTable()
- Drops a table from the database.
Method to escape a string for usage in an SQL statement.
string
escape
(string $text, [boolean $extra = false])
-
string
$text: The string to be escaped.
-
boolean
$extra: Optional parameter to provide extra escaping.
Redefinition of:
- JDatabaseDriver::escape()
- Escapes a string for usage in an SQL statement.
Method to fetch a row from the result set cursor as an array.
mixed
fetchArray
([mixed $cursor = null])
-
mixed
$cursor: The optional result set cursor from which to fetch the row.
Redefinition of:
- JDatabaseDriver::fetchArray()
- Method to fetch a row from the result set cursor as an array.
Method to fetch a row from the result set cursor as an associative array.
mixed
fetchAssoc
([mixed $cursor = null])
-
mixed
$cursor: The optional result set cursor from which to fetch the row.
Redefinition of:
- JDatabaseDriver::fetchAssoc()
- Method to fetch a row from the result set cursor as an associative array.
Method to fetch a row from the result set cursor as an object.
mixed
fetchObject
([mixed $cursor = null], [string $class = 'stdClass'])
-
mixed
$cursor: The optional result set cursor from which to fetch the row.
-
string
$class: The class name to use for the returned row object.
Redefinition of:
- JDatabaseDriver::fetchObject()
- Method to fetch a row from the result set cursor as an object.
Method to free up the memory used for the result set.
void
freeResult
([mixed $cursor = null])
-
mixed
$cursor: The optional result set cursor from which to fetch the row.
Redefinition of:
- JDatabaseDriver::freeResult()
- Method to free up the memory used for the result set.
Get the number of affected rows for the previous executed SQL statement.
integer
getAffectedRows
()
Redefinition of:
- JDatabaseDriver::getAffectedRows()
- Get the number of affected rows for the previous executed SQL statement.
Get the query string to alter the database character set.
string
getAlterDbCharacterSet
(string $dbName)
-
string
$dbName: The database name
Redefinition of:
- JDatabaseDriver::getAlterDbCharacterSet()
- Return the query string to alter the database character set.
Method to get the database collation in use by sampling a text field of a table in the database.
mixed
getCollation
()
Redefinition of:
- JDatabaseDriver::getCollation()
- Method to get the database collation in use by sampling a text field of a table in the database.
Get the query string to create new Database in correct PostgreSQL syntax.
string
getCreateDbQuery
(object $options, boolean $utf)
-
object
$options: object coming from "initialise" function to pass user and database name to database driver.
-
boolean
$utf: True if the database supports the UTF-8 character set, not used in PostgreSQL "CREATE DATABASE" query.
Get the number of returned rows for the previous executed SQL statement.
integer
getNumRows
([resource $cur = null])
-
resource
$cur: An optional database cursor resource to extract the row count from.
Redefinition of:
- JDatabaseDriver::getNumRows()
- Get the number of returned rows for the previous executed SQL statement.
Get the current or query, or new JDatabaseQuery object.
JDatabaseQuery
getQuery
([
boolean $new =
false], [
boolean $asObj =
false])
-
boolean
$new: False to return the last query set, True to return a new JDatabaseQuery object.
-
boolean
$asObj: False to return last query as string, true to get JDatabaseQueryPostgresql object.
Redefinition of:
- JDatabaseDriver::getQuery()
- Get the current query object or a new JDatabaseQuery object.
Generate a random value
float
getRandom
()
Get the substring position inside a string
integer
getStringPositionSQL
(string $substring, string $string)
-
string
$substring: The string being sought
-
string
$string: The string/column being searched
Retrieves field information about a given table.
array
getTableColumns
(string $table, [boolean $typeOnly = true])
-
string
$table: The name of the database table.
-
boolean
$typeOnly: True to only return field types.
Redefinition of:
- JDatabaseDriver::getTableColumns()
- Retrieves field information about the given tables.
Shows the table CREATE statement that creates the given tables.
This is unsuported by PostgreSQL.
string
getTableCreate
(mixed $tables)
-
mixed
$tables: A table name or a list of table names.
Redefinition of:
- JDatabaseDriver::getTableCreate()
- Shows the table CREATE statement that creates the given tables.
Get the details list of keys for a table.
array
getTableKeys
(string $table)
-
string
$table: The name of the table.
Redefinition of:
- JDatabaseDriver::getTableKeys()
- Retrieves field information about the given tables.
Method to get an array of all tables in the database.
array
getTableList
()
Redefinition of:
- JDatabaseDriver::getTableList()
- Method to get an array of all tables in the database.
Get the details list of sequences for a table.
array
getTableSequences
(string $table)
-
string
$table: The name of the table.
Get the version of the database connector.
string
getVersion
()
Redefinition of:
- JDatabaseDriver::getVersion()
- Get the version of the database connector
Method to get the auto-incremented value from the last INSERT statement.
To be called after the INSERT statement, it's MANDATORY to have a sequence on every primary key table.
To get the auto incremented value it's possible to call this function after INSERT INTO query, or use INSERT INTO with RETURNING clause.
integer
insertid
()
Redefinition of:
- JDatabaseDriver::insertid()
- Method to get the auto-incremented value from the last INSERT statement.
Inserts a row into a table based on an object's properties.
boolean
insertObject
(string $table, object &$object, [string $key = null])
-
string
$table: The name of the database table to insert into.
-
object
&$object: A reference to an object whose public properties match the table fields.
-
string
$key: The name of the primary key. If provided the object property is updated.
Redefinition of:
- JDatabaseDriver::insertObject()
- Inserts a row into a table based on an object's properties.
Locks a table in the database.
-
string
$tableName: The name of the table to unlock.
Redefinition of:
- JDatabaseDriver::lockTable()
- Locks a table in the database.
Method to release a savepoint.
void
releaseTransactionSavepoint
(string $savepointName)
-
string
$savepointName: Savepoint's name to release
Renames a table in the database.
-
string
$oldTable: The name of the table to be renamed
-
string
$newTable: The new name for the table.
-
string
$backup: Not used by PostgreSQL.
-
string
$prefix: Not used by PostgreSQL.
Redefinition of:
- JDatabaseDriver::renameTable()
- Renames a table in the database.
This function replaces a string identifier $prefix with the string held is the tablePrefix class variable.
string
replacePrefix
(string $query, [string $prefix = '#__'])
-
string
$query: The SQL statement to prepare.
-
string
$prefix: The common table prefix.
Redefinition of:
- JDatabaseDriver::replacePrefix()
- This function replaces a string identifier $prefix with the string held is the tablePrefix class variable.
Selects the database, but redundant for PostgreSQL
boolean
select
(string $database)
-
string
$database: Database name to select.
Redefinition of:
- JDatabaseDriver::select()
- Select a database for use.
Custom settings for UTF support
integer
setUTF
()
Redefinition of:
- JDatabaseDriver::setUTF()
- Set the connection to use UTF-8 character encoding.
Returns an array containing database's table list.
array
showTables
()
This function return a field value as a prepared string to be used in a SQL statement.
string
sqlValue
(array $columns, string $field_name, string $field_value)
-
array
$columns: Array of table's column returned by ::getTableColumns.
-
string
$field_name: The table field's name.
-
string
$field_value: The variable value to quote and return.
Method to commit a transaction.
void
transactionCommit
([boolean $toSavepoint = false])
-
boolean
$toSavepoint: If true, commit to the last savepoint.
Redefinition of:
- JDatabaseDriver::transactionCommit()
- Method to commit a transaction.
Method to roll back a transaction.
void
transactionRollback
([boolean $toSavepoint = false])
-
boolean
$toSavepoint: If true, rollback to the last savepoint.
Redefinition of:
- JDatabaseDriver::transactionRollback()
- Method to roll back a transaction.
Method to create a savepoint.
void
transactionSavepoint
(string $savepointName)
-
string
$savepointName: Savepoint's name to create
Method to initialize a transaction.
void
transactionStart
([boolean $asSavepoint = false])
-
boolean
$asSavepoint: If true and a transaction is already active, a savepoint will be created.
Redefinition of:
- JDatabaseDriver::transactionStart()
- Method to initialize a transaction.
Unlocks tables in the database, this command does not exist in PostgreSQL, it is automatically done on commit or rollback.
Redefinition of:
- JDatabaseDriver::unlockTables()
- Unlocks tables in the database.
Updates a row in a table based on an object's properties.
boolean
updateObject
(string $table, object &$object, array $key, [boolean $nulls = false])
-
string
$table: The name of the database table to update.
-
object
&$object: A reference to an object whose public properties match the table fields.
-
array
$key: The name of the primary key.
-
boolean
$nulls: True to update null fields or false to ignore them.
Redefinition of:
- JDatabaseDriver::updateObject()
- Updates a row in a table based on an object's properties.
Inherited Methods
Inherited From JDatabaseDriver
JDatabaseDriver::__construct()
JDatabaseDriver::addDisconnectHandler()
JDatabaseDriver::alterDbCharacterSet()
JDatabaseDriver::connect()
JDatabaseDriver::connected()
JDatabaseDriver::createDatabase()
JDatabaseDriver::disconnect()
JDatabaseDriver::dropTable()
JDatabaseDriver::escape()
JDatabaseDriver::execute()
JDatabaseDriver::fetchArray()
JDatabaseDriver::fetchAssoc()
JDatabaseDriver::fetchObject()
JDatabaseDriver::freeResult()
JDatabaseDriver::getAffectedRows()
JDatabaseDriver::getAlterDbCharacterSet()
JDatabaseDriver::getCallStacks()
JDatabaseDriver::getCollation()
JDatabaseDriver::getConnection()
JDatabaseDriver::getConnectors()
JDatabaseDriver::getCount()
JDatabaseDriver::getCreateDatabaseQuery()
JDatabaseDriver::getDatabase()
JDatabaseDriver::getDateFormat()
JDatabaseDriver::getExporter()
JDatabaseDriver::getImporter()
JDatabaseDriver::getInstance()
JDatabaseDriver::getIterator()
JDatabaseDriver::getLog()
JDatabaseDriver::getMinimum()
JDatabaseDriver::getNullDate()
JDatabaseDriver::getNumRows()
JDatabaseDriver::getPrefix()
JDatabaseDriver::getQuery()
JDatabaseDriver::getTableColumns()
JDatabaseDriver::getTableCreate()
JDatabaseDriver::getTableKeys()
JDatabaseDriver::getTableList()
JDatabaseDriver::getTimings()
JDatabaseDriver::getUTFSupport()
JDatabaseDriver::getVersion()
JDatabaseDriver::hasUTFSupport()
JDatabaseDriver::insertid()
JDatabaseDriver::insertObject()
JDatabaseDriver::isMinimumVersion()
JDatabaseDriver::loadAssoc()
JDatabaseDriver::loadAssocList()
JDatabaseDriver::loadColumn()
JDatabaseDriver::loadNextObject()
JDatabaseDriver::loadNextRow()
JDatabaseDriver::loadObject()
JDatabaseDriver::loadObjectList()
JDatabaseDriver::loadResult()
JDatabaseDriver::loadRow()
JDatabaseDriver::loadRowList()
JDatabaseDriver::lockTable()
JDatabaseDriver::quote()
JDatabaseDriver::quoteName()
JDatabaseDriver::quoteNameStr()
JDatabaseDriver::renameTable()
JDatabaseDriver::replacePrefix()
JDatabaseDriver::select()
JDatabaseDriver::setDebug()
JDatabaseDriver::setQuery()
JDatabaseDriver::setUTF()
JDatabaseDriver::splitSql()
JDatabaseDriver::transactionCommit()
JDatabaseDriver::transactionRollback()
JDatabaseDriver::transactionStart()
JDatabaseDriver::truncateTable()
JDatabaseDriver::unlockTables()
JDatabaseDriver::updateObject()
JDatabaseDriver::__call()
Inherited From JDatabase
JDatabase::getConnectors()
JDatabase::getErrorMsg()
JDatabase::getErrorNum()
JDatabase::getInstance()
JDatabase::query()
JDatabase::splitSql()
JDatabase::stderr()
JDatabase::test()