Class JDatabaseDriverPostgresql

Description

PostgreSQL database driver

  • since: 12.1

Located in /libraries/joomla/database/driver/postgresql.php (line 19)

JDatabase
   |
   --JDatabaseDriver
      |
      --JDatabaseDriverPostgresql
Variable Summary
 static string $dbMinimum
 string $name
 string $nameQuote
 string $nullDate
 JDatabaseDriverPostgresqlQuery $queryObject
Method Summary
 static boolean isSupported ()
 static boolean test ()
 JDatabaseDriverPostgresql __construct (array $options)
 void __destruct ()
 void connect ()
 boolean connected ()
 void disconnect ()
 boolean dropTable (string $tableName, [boolean $ifExists = true])
 string escape (string $text, [boolean $extra = false])
 mixed execute ()
 mixed fetchArray ([mixed $cursor = null])
 mixed fetchAssoc ([mixed $cursor = null])
 mixed fetchObject ([mixed $cursor = null], [string $class = 'stdClass'])
 void freeResult ([mixed $cursor = null])
 integer getAffectedRows ()
 string getAlterDbCharacterSet (string $dbName)
 mixed getCollation ()
 string getCreateDbQuery (object $options, boolean $utf)
 integer getNumRows ([resource $cur = null])
 JDatabaseQuery getQuery ([boolean $new = false], [boolean $asObj = false])
 float getRandom ()
 integer getStringPositionSQL (string $substring, string $string)
 array getTableColumns (string $table, [boolean $typeOnly = true])
 string getTableCreate (mixed $tables)
 array getTableKeys (string $table)
 array getTableList ()
 array getTableSequences (string $table)
 string getVersion ()
 integer insertid ()
 boolean insertObject (string $table, object &$object, [string $key = null])
 JDatabaseDriverPostgresql lockTable (string $tableName)
 void releaseTransactionSavepoint (string $savepointName)
 JDatabaseDriverPostgresql renameTable (string $oldTable, string $newTable, [string $backup = null], [string $prefix = null])
 string replacePrefix (string $query, [string $prefix = '#__'])
 boolean select (string $database)
 integer setUTF ()
 array showTables ()
 string sqlValue (array $columns, string $field_name, string $field_value)
 void transactionCommit ([boolean $toSavepoint = false])
 void transactionRollback ([boolean $toSavepoint = false])
 void transactionSavepoint (string $savepointName)
 void transactionStart ([boolean $asSavepoint = false])
 boolean updateObject (string $table, object &$object, array $key, [boolean $nulls = false])
Variables
static string $dbMinimum = '8.3.18' (line 51)

The minimum supported database version.

  • since: 12.1
  • access: protected

Redefinition of:
JDatabaseDriver::$dbMinimum
string $concat_operator = '||' (line 59)

Operator used for concatenation

  • since: 12.1
  • access: protected
string $name = 'postgresql' (line 27)

The database driver name

  • since: 12.1
  • access: public

Redefinition of:
JDatabaseDriver::$name
The name of the database driver.
string $nameQuote = '"' (line 35)

Quote for named objects

  • since: 12.1
  • access: protected

Redefinition of:
JDatabaseDriver::$nameQuote
string $nullDate = '1970-01-01 00:00:00' (line 43)

The null/zero date string

  • since: 12.1
  • access: protected

Redefinition of:
JDatabaseDriver::$nullDate
JDatabaseDriverPostgresqlQuery $queryObject = null (line 67)

JDatabaseDriverPostgresqlQuery object returned by getQuery

  • since: 12.1
  • access: protected

Inherited Variables

Inherited from JDatabaseDriver

JDatabaseDriver::$callStacks
JDatabaseDriver::$connection
JDatabaseDriver::$count
JDatabaseDriver::$cursor
JDatabaseDriver::$debug
JDatabaseDriver::$disconnectHandlers
JDatabaseDriver::$errorMsg
JDatabaseDriver::$errorNum
JDatabaseDriver::$instances
JDatabaseDriver::$limit
JDatabaseDriver::$log
JDatabaseDriver::$offset
JDatabaseDriver::$options
JDatabaseDriver::$sql
JDatabaseDriver::$tablePrefix
JDatabaseDriver::$timings
JDatabaseDriver::$transactionDepth
JDatabaseDriver::$utf
Methods
static isSupported (line 1114)

Test to see if the PostgreSQL connector is available.

  • return: True on success, false otherwise.
  • since: 12.1
  • access: public
static boolean isSupported ()
static test (line 185)

Test to see if the PostgreSQL connector is available

  • return: True on success, false otherwise.
  • since: 12.1
  • access: public
static boolean test ()

Redefinition of:
JDatabase::test()
Test to see if the connector is available.
Constructor __construct (line 76)

Database object constructor

  • since: 12.1
  • access: public
JDatabaseDriverPostgresql __construct (array $options)
  • array $options: List of options used to configure the connection

Redefinition of:
JDatabaseDriver::__construct()
Constructor.
Destructor __destruct (line 92)

Database object destructor

  • since: 12.1
  • access: public
void __destruct ()
connect (line 105)

Connects to the database if needed.

  • return: Returns void if the database connected successfully.
  • since: 12.1
  • throws: RuntimeException
  • access: public
void connect ()

Redefinition of:
JDatabaseDriver::connect()
Connects to the database if needed.
connected (line 197)

Determines if the connection to the server is active.

  • since: 12.1
  • access: public
boolean connected ()

Redefinition of:
JDatabaseDriver::connected()
Determines if the connection to the server is active.
disconnect (line 138)

Disconnects the database.

  • since: 12.1
  • access: public
void disconnect ()

Redefinition of:
JDatabaseDriver::disconnect()
Disconnects the database.
dropTable (line 220)

Drops a table from the database.

  • since: 12.1
  • throws: RuntimeException
  • access: public
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.
escape (line 164)

Method to escape a string for usage in an SQL statement.

  • return: The escaped string.
  • since: 12.1
  • access: public
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.
execute (line 618)

Execute the SQL statement.

  • return: A database cursor resource on success, boolean false on failure.
  • since: 12.1
  • throws: RuntimeException
  • access: public
mixed execute ()

Redefinition of:
JDatabaseDriver::execute()
Execute the SQL statement.
fetchArray (line 983)

Method to fetch a row from the result set cursor as an array.

  • return: Either the next row from the result set or false if there are no more rows.
  • since: 12.1
  • access: protected
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.
fetchAssoc (line 997)

Method to fetch a row from the result set cursor as an associative array.

  • return: Either the next row from the result set or false if there are no more rows.
  • since: 12.1
  • access: protected
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.
fetchObject (line 1012)

Method to fetch a row from the result set cursor as an object.

  • return: Either the next row from the result set or false if there are no more rows.
  • since: 12.1
  • access: protected
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.
freeResult (line 1026)

Method to free up the memory used for the result set.

  • since: 12.1
  • access: protected
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.
getAffectedRows (line 237)

Get the number of affected rows for the previous executed SQL statement.

  • return: The number of affected rows in the previous operation
  • since: 12.1
  • access: public
integer getAffectedRows ()

Redefinition of:
JDatabaseDriver::getAffectedRows()
Get the number of affected rows for the previous executed SQL statement.
getAlterDbCharacterSet (line 1189)

Get the query string to alter the database character set.

  • return: The query that alter the database query string
  • since: 12.1
  • access: public
string getAlterDbCharacterSet (string $dbName)
  • string $dbName: The database name

Redefinition of:
JDatabaseDriver::getAlterDbCharacterSet()
Return the query string to alter the database character set.
getCollation (line 252)

Method to get the database collation in use by sampling a text field of a table in the database.

  • return: The collation in use by the database or boolean false if not supported.
  • since: 12.1
  • throws: RuntimeException
  • access: public
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.
getCreateDbQuery (line 1206)

Get the query string to create new Database in correct PostgreSQL syntax.

  • return: The query that creates database, owned by $options['user']
  • since: 12.1
  • access: public
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.
getNumRows (line 271)

Get the number of returned rows for the previous executed SQL statement.

  • return: The number of returned rows.
  • since: 12.1
  • access: public
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.
getQuery (line 289)

Get the current or query, or new JDatabaseQuery object.

  • return: The current query object or a new object extending the JDatabaseQuery class.
  • since: 12.1
  • throws: RuntimeException
  • access: public
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.
getRandom (line 1170)

Generate a random value

  • return: The random generated number
  • since: 12.1
  • access: public
float getRandom ()
getStringPositionSQL (line 1152)

Get the substring position inside a string

  • return: The position of $substring in $string
  • since: 12.1
  • access: public
integer getStringPositionSQL (string $substring, string $string)
  • string $substring: The string being sought
  • string $string: The string/column being searched
getTableColumns (line 343)

Retrieves field information about a given table.

  • return: An array of fields for the database table.
  • since: 12.1
  • throws: RuntimeException
  • access: public
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.
getTableCreate (line 327)

Shows the table CREATE statement that creates the given tables.

This is unsuported by PostgreSQL.

  • return: An empty char because this function is not supported by PostgreSQL.
  • since: 12.1
  • access: public
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.
getTableKeys (line 416)

Get the details list of keys for a table.

  • return: An array of the column specification for the table.
  • since: 12.1
  • throws: RuntimeException
  • access: public
array getTableKeys (string $table)
  • string $table: The name of the table.

Redefinition of:
JDatabaseDriver::getTableKeys()
Retrieves field information about the given tables.
getTableList (line 455)

Method to get an array of all tables in the database.

  • return: An array of all the tables in the database.
  • since: 12.1
  • throws: RuntimeException
  • access: public
array getTableList ()

Redefinition of:
JDatabaseDriver::getTableList()
Method to get an array of all tables in the database.
getTableSequences (line 482)

Get the details list of sequences for a table.

  • return: An array of sequences specification for the table.
  • since: 12.1
  • throws: RuntimeException
  • access: public
array getTableSequences (string $table)
  • string $table: The name of the table.
getVersion (line 529)

Get the version of the database connector.

  • return: The database connector version.
  • since: 12.1
  • access: public
string getVersion ()

Redefinition of:
JDatabaseDriver::getVersion()
Get the version of the database connector
insertid (line 567)

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.

  • return: The value of the auto-increment field from the last inserted row.
  • since: 12.1
  • access: public
  • example: example not found
  • example: example not found
integer insertid ()

Redefinition of:
JDatabaseDriver::insertid()
Method to get the auto-incremented value from the last INSERT statement.
insertObject (line 1043)

Inserts a row into a table based on an object's properties.

  • return: True on success.
  • since: 12.1
  • throws: RuntimeException
  • access: public
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.
lockTable (line 602)

Locks a table in the database.

  • return: Returns this object to support chaining.
  • since: 12.1
  • throws: RuntimeException
  • access: public
JDatabaseDriverPostgresql lockTable (string $tableName)
  • string $tableName: The name of the table to unlock.

Redefinition of:
JDatabaseDriver::lockTable()
Locks a table in the database.
releaseTransactionSavepoint (line 1303)

Method to release a savepoint.

  • since: 12.1
  • access: public
void releaseTransactionSavepoint (string $savepointName)
  • string $savepointName: Savepoint's name to release
renameTable (line 727)

Renames a table in the database.

  • return: Returns this object to support chaining.
  • since: 12.1
  • throws: RuntimeException
  • access: public
JDatabaseDriverPostgresql renameTable (string $oldTable, string $newTable, [string $backup = null], [string $prefix = null])
  • 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.
replacePrefix (line 1229)

This function replaces a string identifier $prefix with the string held is the tablePrefix class variable.

  • return: The processed SQL statement.
  • since: 12.1
  • access: public
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.
select (line 802)

Selects the database, but redundant for PostgreSQL

  • return: Always true
  • since: 12.1
  • access: public
boolean select (string $database)
  • string $database: Database name to select.

Redefinition of:
JDatabaseDriver::select()
Select a database for use.
setUTF (line 814)

Custom settings for UTF support

  • return: Zero on success, -1 on failure
  • since: 12.1
  • access: public
integer setUTF ()

Redefinition of:
JDatabaseDriver::setUTF()
Set the connection to use UTF-8 character encoding.
showTables (line 1126)

Returns an array containing database's table list.

  • return: The database's table list.
  • since: 12.1
  • access: public
array showTables ()
sqlValue (line 832)

This function return a field value as a prepared string to be used in a SQL statement.

  • return: The quoted string.
  • since: 12.1
  • access: public
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.
transactionCommit (line 890)

Method to commit a transaction.

  • since: 12.1
  • throws: RuntimeException
  • access: public
void transactionCommit ([boolean $toSavepoint = false])
  • boolean $toSavepoint: If true, commit to the last savepoint.

Redefinition of:
JDatabaseDriver::transactionCommit()
Method to commit a transaction.
transactionRollback (line 917)

Method to roll back a transaction.

  • since: 12.1
  • throws: RuntimeException
  • access: public
void transactionRollback ([boolean $toSavepoint = false])
  • boolean $toSavepoint: If true, rollback to the last savepoint.

Redefinition of:
JDatabaseDriver::transactionRollback()
Method to roll back a transaction.
transactionSavepoint (line 1319)

Method to create a savepoint.

  • since: 12.1
  • access: public
void transactionSavepoint (string $savepointName)
  • string $savepointName: Savepoint's name to create
transactionStart (line 951)

Method to initialize a transaction.

  • since: 12.1
  • throws: RuntimeException
  • access: public
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.
unlockTables (line 1335)

Unlocks tables in the database, this command does not exist in PostgreSQL, it is automatically done on commit or rollback.

  • return: Returns this object to support chaining.
  • since: 12.1
  • throws: RuntimeException
  • access: public
JDatabaseDriverPostgresql unlockTables ()

Redefinition of:
JDatabaseDriver::unlockTables()
Unlocks tables in the database.
updateObject (line 1355)

Updates a row in a table based on an object's properties.

  • return: True on success.
  • since: 12.1
  • throws: RuntimeException
  • access: public
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()

Documentation generated on Tue, 19 Nov 2013 15:11:08 +0100 by phpDocumentor 1.4.3