Doctrine


Doctrine\DBAL\Platforms\PostgreSqlPlatform
/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 36

Class PostgreSqlPlatform

Class:PostgreSqlPlatform - Superclass: AbstractPlatform
AbstractPlatform
⌊ PostgreSqlPlatform

public class PostgreSqlPlatform
extends AbstractPlatform

PostgreSqlPlatform.

Since:
2.0
Author:
Roman Borschel
Lukas Smith (PEAR MDB2 library)
Benjamin Eberlei
Todo:
Rename: PostgreSQLPlatform
License:
http://www.opensource.org/licenses/lgpl-license.php LGPL
See Also:
www.doctrine-project.org
Version:
$Revision: 3938 $

Fields inherited from Doctrine\DBAL\Platforms\AbstractPlatform
CREATE_FOREIGNKEYS, CREATE_INDEXES, TRIM_BOTH, TRIM_LEADING, TRIM_TRAILING, TRIM_UNSPECIFIED
Method Summary
void

convertBooleans(array item)

Postgres wants boolean values converted to the strings 'true'/'false'.

string

getAdvancedForeignKeyOptionsSQL(\Doctrine\DBAL\Schema\ForeignKeyConstraint foreignKey)

Return the FOREIGN KEY query section dealing with non-standard options as MATCH, INITIALLY DEFERRED, ON UPDATE, ...

array

getAlterTableSQL(TableDiff diff, string name, array changes, boolean check)

generates the sql for altering an existing table on postgresql

string

getBigIntTypeDeclarationSQL(mixed field, array columnDef)

string

getBooleanTypeDeclarationSQL(mixed field, array columnDef)

void

getClobTypeDeclarationSQL(array field)

@override

void

getCreateDatabaseSQL(string name, mixed database)

create a new database

string

getCreateSequenceSQL(\Doctrine\DBAL\Schema\Sequence sequence)

Gets the SQL to create a sequence on this platform.

void

getCreateViewSQL(mixed name, mixed sql)

string

getDateTimeFormatString()

Gets the format string, as accepted by the date() function, that describes the format of a stored datetime value of this platform.

string

getDateTimeTypeDeclarationSQL(array fieldDeclaration)

string

getDateTypeDeclarationSQL(array fieldDeclaration)

void

getDropDatabaseSQL(string name, mixed database)

drop an existing database

string

getDropForeignKeySQL(ForeignKeyConstraint|string foreignKey, Table|string table)

string

getDropSequenceSQL(\Doctrine\DBAL\Schema\Sequence sequence)

Drop existing sequence

void

getDropViewSQL(mixed name)

string

getEmptyIdentityInsertSQL(mixed quotedTableName, mixed quotedIdentifierColumnName, string tableName, string identifierColumnName)

Get the insert sql for an empty insert statement

string

getIntegerTypeDeclarationSQL(mixed field, array columnDef)

void

getListDatabasesSQL()

void

getListSequencesSQL(mixed database)

void

getListTableColumnsSQL(mixed table)

void

getListTableConstraintsSQL(mixed table)

void

getListTableForeignKeysSQL(mixed table, mixed database)

string

getListTableIndexesSQL(string table)

void

getListTablesSQL()

string

getListViewsSQL(string database)

Get the SQL to list all views of a database or user.

integer

getLocateExpression(string str, string substr, mixed startPos, int pos)

returns the position of the first occurrence of substring $substr in string $str

string

getName()

Get the platform name for this instance

string

getNowExpression()

Returns the SQL string to return the current system date and time.

string

getRegexpExpression()

regexp

string

getSQLResultCasing(string column)

Gets the character casing of a column in an SQL result set.

void

getSequenceNextValSQL(mixed sequenceName)

void

getSetTransactionIsolationSQL(integer level)

Get sql to set the transaction isolation level

string

getSmallIntTypeDeclarationSQL(mixed field, array columnDef)

string

getSubstringExpression(string value, int from, int len)

Returns part of a string.

string

getTimeTypeDeclarationSQL(array fieldDeclaration)

string

getTruncateTableSQL(string tableName, bool cascade)

void

getVarcharTypeDeclarationSQL(array field)

Gets the SQL snippet used to declare a VARCHAR column on the MySql platform.

boolean

prefersSequences()

Whether the platform prefers sequences for ID generation.

boolean

supportsIdentityColumns()

Whether the platform supports identity columns.

boolean

supportsSchemas()

Whether the platform supports database schemas.

boolean

supportsSequences()

Whether the platform supports sequences.

Methods inherited from Doctrine\DBAL\Platforms\AbstractPlatform
convertBooleans, createsExplicitIndexForForeignKeys, fixSchemaElementName, getAcosExpression, getAdvancedForeignKeyOptionsSQL, getAlterTableSQL, getAvgExpression, getBetweenExpression, getBigIntTypeDeclarationSQL, getBooleanTypeDeclarationSQL, getCheckDeclarationSQL, getClobTypeDeclarationSQL, getColumnCharsetDeclarationSQL, getColumnCollationDeclarationSQL, getColumnDeclarationListSQL, getColumnDeclarationSQL, getConcatExpression, getCosExpression, getCountExpression, getCreateConstraintSQL, getCreateDatabaseSQL, getCreateForeignKeySQL, getCreateIndexSQL, getCreateSequenceSQL, getCreateTableSQL, getCreateTemporaryTableSnippetSQL, getCreateViewSQL, getCurrentDateSQL, getCurrentTimeSQL, getCurrentTimestampSQL, getCustomTypeDeclarationSQL, getDateFormatString, getDateTimeFormatString, getDateTimeTypeDeclarationSQL, getDateTypeDeclarationSQL, getDecimalTypeDeclarationSQL, getDefaultTransactionIsolationLevel, getDefaultValueDeclarationSQL, getDropConstraintSQL, getDropDatabaseSQL, getDropForeignKeySQL, getDropIndexSQL, getDropSequenceSQL, getDropTableSQL, getDropViewSQL, getEmptyIdentityInsertSQL, getForUpdateSql, getForeignKeyBaseDeclarationSQL, getForeignKeyDeclarationSQL, getForeignKeyReferentialActionSQL, getIdentifierQuoteCharacter, getIdentityColumnNullInsertSQL, getInExpression, getIndexDeclarationSQL, getIndexFieldDeclarationListSQL, getIntegerTypeDeclarationSQL, getIsNotNullExpression, getIsNullExpression, getLengthExpression, getListDatabasesSQL, getListSequencesSQL, getListTableColumnsSQL, getListTableConstraintsSQL, getListTableForeignKeysSQL, getListTableIndexesSQL, getListTablesSQL, getListUsersSQL, getListViewsSQL, getLocateExpression, getLowerExpression, getLtrimExpression, getMaxExpression, getMaxIdentifierLength, getMd5Expression, getMinExpression, getModExpression, getName, getNotExpression, getNowExpression, getPiExpression, getRegexpExpression, getRoundExpression, getRtrimExpression, getSQLResultCasing, getSequenceNextValSQL, getSetCharsetSQL, getSetTransactionIsolationSQL, getShowDatabasesSQL, getSinExpression, getSmallIntTypeDeclarationSQL, getSqlCommentEndString, getSqlCommentStartString, getSubstringExpression, getSumExpression, getTemporaryTableSQL, getTimeFormatString, getTimeTypeDeclarationSQL, getTrimExpression, getTruncateTableSQL, getUniqueConstraintDeclarationSQL, getUniqueFieldDeclarationSQL, getUpperExpression, getVarcharMaxLength, getVarcharTypeDeclarationSQL, getWildcards, modifyLimitQuery, prefersIdentityColumns, prefersSequences, quoteIdentifier, supportsAlterTable, supportsForeignKeyConstraints, supportsForeignKeyOnUpdate, supportsGettingAffectedRows, supportsIdentityColumns, supportsIndexes, supportsPrimaryConstraints, supportsSavepoints, supportsSchemas, supportsSequences, supportsTransactions

Method Detail

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 427

convertBooleans

public void convertBooleans(array item)

Postgres wants boolean values converted to the strings 'true'/'false'.

Override.

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 268

getAdvancedForeignKeyOptionsSQL

public string getAdvancedForeignKeyOptionsSQL(\Doctrine\DBAL\Schema\ForeignKeyConstraint foreignKey)

Return the FOREIGN KEY query section dealing with non-standard options as MATCH, INITIALLY DEFERRED, ON UPDATE, ...

Parameters:
foreignKey - foreign key definition
Override.

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 300

getAlterTableSQL

public array getAlterTableSQL(TableDiff diff, string name, array changes, boolean check)

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.
See Also:
Doctrine_Export::alterTable()
Override.

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 477

getBigIntTypeDeclarationSQL

public string getBigIntTypeDeclarationSQL(mixed field, array columnDef)

Override.

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 457

getBooleanTypeDeclarationSQL

public string getBooleanTypeDeclarationSQL(mixed field, array columnDef)

Override.

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 549

getClobTypeDeclarationSQL

public void getClobTypeDeclarationSQL(array field)


/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 243

getCreateDatabaseSQL

public void getCreateDatabaseSQL(string name, mixed database)

create a new database

Parameters:
name - name of the database that should be created
Throws:
PDOException
Override.

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 354

getCreateSequenceSQL

public string getCreateSequenceSQL(\Doctrine\DBAL\Schema\Sequence sequence)

Gets the SQL to create a sequence on this platform.

Throws:
DBALException

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 204

getCreateViewSQL

public void getCreateViewSQL(mixed name, mixed sql)

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 577

getDateTimeFormatString

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.

Returns:
The format string.
Todo:
We need to get the specific format for each dbms and override this function for each platform

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 496

getDateTimeTypeDeclarationSQL

public string getDateTimeTypeDeclarationSQL(array fieldDeclaration)

Override.

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 504

getDateTypeDeclarationSQL

public string getDateTypeDeclarationSQL(array fieldDeclaration)

Override.

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 255

getDropDatabaseSQL

public void getDropDatabaseSQL(string name, mixed database)

drop an existing database

Parameters:
name - name of the database that should be dropped
Throws:
PDOException

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 380

getDropForeignKeySQL

public string getDropForeignKeySQL(ForeignKeyConstraint|string foreignKey, Table|string table)


/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 367

getDropSequenceSQL

public string getDropSequenceSQL(\Doctrine\DBAL\Schema\Sequence sequence)

Drop existing sequence


/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 209

getDropViewSQL

public void getDropViewSQL(mixed name)

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 589

getEmptyIdentityInsertSQL

public string getEmptyIdentityInsertSQL(mixed quotedTableName, mixed quotedIdentifierColumnName, string tableName, string identifierColumnName)

Get the insert sql for an empty insert statement

Returns:
$sql

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 465

getIntegerTypeDeclarationSQL

public string getIntegerTypeDeclarationSQL(mixed field, array columnDef)

Override.

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 151

getListDatabasesSQL

public void getListDatabasesSQL()

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 156

getListSequencesSQL

public void getListSequencesSQL(mixed database)

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 230

getListTableColumnsSQL

public void getListTableColumnsSQL(mixed table)

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 214

getListTableConstraintsSQL

public void getListTableConstraintsSQL(mixed table)

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 190

getListTableForeignKeysSQL

public void getListTableForeignKeysSQL(mixed table, mixed database)

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 225

getListTableIndexesSQL

public string getListTableIndexesSQL(string table)

License:
New BSD License
See Also:
http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 167

getListTablesSQL

public void getListTablesSQL()

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 185

getListViewsSQL

public string getListViewsSQL(string database)

Get the SQL to list all views of a database or user.


/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 87

getLocateExpression

public integer getLocateExpression(string str, string substr, mixed startPos, int pos)

returns the position of the first occurrence of substring $substr in string $str

Parameters:
substr - literal string to find
str - literal string
pos - position to start at, beginning of string by default

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 559

getName

public string getName()

Get the platform name for this instance


/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 63

getNowExpression

public string getNowExpression()

Returns the SQL string to return the current system date and time.


/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 74

getRegexpExpression

public string getRegexpExpression()

regexp

Returns:
the regular expression operator
Override.

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 572

getSQLResultCasing

public string getSQLResultCasing(string column)

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:
The column name in the character casing used in SQL result sets.

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 443

getSequenceNextValSQL

public void getSequenceNextValSQL(mixed sequenceName)

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 448

getSetTransactionIsolationSQL

public void getSetTransactionIsolationSQL(integer level)

Get sql to set the transaction isolation level


/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 488

getSmallIntTypeDeclarationSQL

public string getSmallIntTypeDeclarationSQL(mixed field, array columnDef)

Override.

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 49

getSubstringExpression

public string getSubstringExpression(string value, int from, int len)

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:
sql that extracts part of a string.
Override.

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 512

getTimeTypeDeclarationSQL

public string getTimeTypeDeclarationSQL(array fieldDeclaration)

Override.

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 597

getTruncateTableSQL

public string getTruncateTableSQL(string tableName, bool cascade)

Inheritdoc.

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 531

getVarcharTypeDeclarationSQL

public void getVarcharTypeDeclarationSQL(array field)

Gets the SQL snippet used to declare a VARCHAR column on the MySql platform.

Params:
array $field
Override.

/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 146

prefersSequences

public boolean prefersSequences()

Whether the platform prefers sequences for ID generation.


/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 136

supportsIdentityColumns

public boolean supportsIdentityColumns()

Whether the platform supports identity columns. Postgres supports these through the SERIAL keyword.


/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 125

supportsSchemas

public boolean supportsSchemas()

Whether the platform supports database schemas.


/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php at line 115

supportsSequences

public boolean supportsSequences()

Whether the platform supports sequences. Postgres has native support for sequences.


Doctrine