Methods summary
public
#
__construct ( )
Constructor.
Creates a new PostgreSqlPlatform.
Constructor.
Creates a new PostgreSqlPlatform.
Overrides
public
string
#
getMd5Expression ( $column )
Returns the md5 sum of a field.
Returns the md5 sum of a field.
Note: Not SQL92, but common functionality
md5() works with the default PostgreSQL 8 versions.
If you are using PostgreSQL 7.x or older you need
to make sure that the digest procedure is installed.
If you use RPMS (Redhat and Mandrake) install the postgresql-contrib
package. You must then install the procedure by running this shell command:
psql [dbname] < /usr/share/pgsql/contrib/pgcrypto.sql
You should make sure you run this as the postgres user.
Returns
string
Override
Overrides
public
string
#
getSubstringExpression ( string $value , integer $from , integer $len = null )
Returns part of a string.
Returns part of a string.
Note: Not SQL92, but common functionality.
Parameters
$value
the target $value the string or the string column.
$from
extract from this characeter.
$len
extract this amount of characters.
Returns
string sql that extracts part of a string.
Override
Overrides
public
string
#
getAgeExpression ( string $timestamp1 , string $timestamp2 = null )
PostgreSQLs AGE( [, ]) function.
PostgreSQLs AGE( [, ]) function.
Parameters
$timestamp1
timestamp to subtract from NOW()
$timestamp2
optional; if given: subtract arguments
Returns
string
public
string
#
getDatePartExpression ( string $text , string $time )
PostgreSQLs DATE_PART( , ) function.
PostgreSQLs DATE_PART( , ) function.
Parameters
$text
what to extract
$time
timestamp or interval to extract from
Returns
string
public
string
#
getToCharExpression ( string $time , string $text )
PostgreSQLs TO_CHAR( , ) function.
PostgreSQLs TO_CHAR( , ) function.
Parameters
$time
timestamp or interval
$text
how to the format the output
Returns
string
public
string
#
getNowExpression ( )
Returns the SQL string to return the current system date and time.
Returns the SQL string to return the current system date and time.
Returns
string
Overrides
public
string
public
return
#
getRandomExpression ( )
return string to call a function to get random value inside an SQL statement
return string to call a function to get random value inside an SQL statement
Returns
return string to generate float between 0 and 1
Override
public
string
#
getMatchPatternExpression ( array $pattern , string $operator = null , string $field = null )
build a pattern matching string
build a pattern matching string
EXPERIMENTAL
WARNING: this function is experimental and may change signature at
any time until labelled as non-experimental
Parameters
$pattern
even keys are strings, odd are patterns (% and _)
$operator
optional pattern operator (LIKE, ILIKE and maybe others in the future)
$field
optional field name that is being matched against
(might be required when emulating ILIKE)
Returns
string SQL pattern
Override
Overrides
public
boolean
#
supportsSequences ( )
Whether the platform supports sequences.
Postgres has native support for sequences.
Whether the platform supports sequences.
Postgres has native support for sequences.
Returns
boolean
Overrides
public
boolean
#
supportsSchemas ( )
Whether the platform supports database schemas.
Whether the platform supports database schemas.
Returns
boolean
Overrides
public
boolean
#
supportsIdentityColumns ( )
Whether the platform supports identity columns.
Postgres supports these through the SERIAL keyword.
Whether the platform supports identity columns.
Postgres supports these through the SERIAL keyword.
Returns
boolean
Overrides
public
public
public
public
public
public
public
public
public
public
public
public
#
getCreateDatabaseSql ( string $name )
create a new database
Parameters
$name
name of the database that should be created
Throws
PDOException
Override
Overrides
public
#
getDropDatabaseSql ( string $name )
drop an existing database
drop an existing database
Parameters
$name
name of the database that should be dropped
Throws
PDOException
Overrides
public
string
#
getAdvancedForeignKeyOptionsSql ( array $definition )
getAdvancedForeignKeyOptions
Return the FOREIGN KEY query section dealing with non-standard options
as MATCH, INITIALLY DEFERRED, ON UPDATE, ...
getAdvancedForeignKeyOptions
Return the FOREIGN KEY query section dealing with non-standard options
as MATCH, INITIALLY DEFERRED, ON UPDATE, ...
Parameters
$definition
foreign key definition
Returns
string
Override
Overrides
public
array
#
getAlterTableSql ( string $name , array $changes , boolean $check = false )
generates the sql for altering an existing table on postgresql
generates the sql for altering an existing table on postgresql
Parameters
$name
name of the table that is intended to be changed.
$changes
associative array that contains the details of each type *
$check
indicates whether the function should just check if the DBMS driver
can perform the requested table alterations if the value is true or
actually perform them otherwise.
Returns
array
See
Doctrine_Export::alterTable()
Override
Overrides
public
string
#
getCreateSequenceSql ( string $sequenceName , integer $start = 1 , integer $allocationSize = 1 )
Gets the SQL to create a sequence on this platform.
Gets the SQL to create a sequence on this platform.
Parameters
$sequenceName
$start
$allocationSize
Returns
string
Throws
Override
Overrides
public
#
getDropSequenceSql ( string $sequenceName )
drop existing sequence
Parameters
$sequenceName
name of the sequence to be dropped
Override
Overrides
public
unknown
#
getCreateTableSql ( unknown_type $name , array $fields , array $options = array () )
Gets the SQL used to create a table.
Gets the SQL used to create a table.
Parameters
Returns
unknown
Overrides
public
#
convertBooleans ( array $item )
Postgres wants boolean values converted to the strings 'true'/'false'.
Postgres wants boolean values converted to the strings 'true'/'false'.
Parameters
Override
Overrides
public
public
#
getSetTransactionIsolationSql ( integer $level )
Get sql to set the transaction isolation level
Get sql to set the transaction isolation level
Parameters
Overrides
public
string
public
string
public
string
#
getDefaultValueDeclarationSql ( array $field )
Parameters
$field
field definition array
Returns
string DBMS specific SQL code portion needed to set a default value
Override
Overrides
public
string
public
string
public
string
public
string
protected
string
public
#
getVarcharTypeDeclarationSql ( array $field )
Gets the SQL snippet used to declare a VARCHAR column on the MySql platform.
Gets the SQL snippet used to declare a VARCHAR column on the MySql platform.
Parameters
Override
Params
array $field
public
public
string
#
getName ( )
Get the platform name for this instance
Get the platform name for this instance
Returns
string
public
string
#
getSqlResultCasing ( string $column )
Gets the character casing of a column in an SQL result set.
Gets the character casing of a column in an SQL result set.
PostgreSQL returns all column names in SQL result sets in lowercase.
Parameters
$column
The column name for which to get the correct character casing.
Returns
string The column name in the character casing used in SQL result sets.
Overrides
public
string
#
getDateTimeFormatString ( )
Gets the format string, as accepted by the date() function, that describes
the format of a stored datetime value of this platform.
Gets the format string, as accepted by the date() function, that describes
the format of a stored datetime value of this platform.
Returns
string The format string.
Overrides
public
string
#
getEmptyIdentityInsertSql ( string $quotedTableName , string $quotedIdentifierColumnName )
Get the insert sql for an empty insert statement
Get the insert sql for an empty insert statement
Parameters
$quotedTableName
$tableName
$quotedIdentifierColumnName
$identifierColumnName
Returns
string $sql
Overrides