liquibase.database.core
Class PostgresDatabase

java.lang.Object
  extended by liquibase.database.AbstractJdbcDatabase
      extended by liquibase.database.core.PostgresDatabase
All Implemented Interfaces:
Database, PrioritizedService

public class PostgresDatabase
extends AbstractJdbcDatabase

Encapsulates PostgreSQL database support.


Field Summary
static String PRODUCT_NAME
           
 
Fields inherited from class liquibase.database.AbstractJdbcDatabase
caseSensitive, currentDateTimeFunction, dateFunctions, defaultAutoIncrementBy, defaultAutoIncrementStartWith, defaultCatalogName, defaultSchemaName, quotingEndCharacter, quotingStartCharacter, quotingStrategy, sequenceCurrentValueFunction, sequenceNextValueFunction, unmodifiableDataTypes, unquotedObjectsAreUppercased
 
Fields inherited from interface liquibase.servicelocator.PrioritizedService
PRIORITY_DATABASE, PRIORITY_DEFAULT
 
Constructor Summary
PostgresDatabase()
           
 
Method Summary
 String correctObjectName(String objectName, Class<? extends DatabaseObject> objectType)
          Fix the object name to the format the database expects, handling changes in case, etc.
 String escapeObjectName(String objectName, Class<? extends DatabaseObject> objectType)
           
 boolean generateAutoIncrementBy(BigInteger incrementBy)
           
 boolean generateAutoIncrementStartWith(BigInteger startWith)
           
 String getAutoIncrementClause()
           
protected  String getConnectionSchemaName()
          Overwrite this method to get the default schema name for the connection.
 String getDatabaseChangeLogLockTableName()
           
 String getDatabaseChangeLogTableName()
           
protected  String getDefaultDatabaseProductName()
           
 String getDefaultDriver(String url)
          If this database understands the given url, return the default driver class name.
 Integer getDefaultPort()
           
 int getPriority()
           
 String getShortName()
          Returns an all-lower-case short name of the product.
 Set<String> getSystemViews()
          Returns system (undroppable) views.
protected  boolean hasMixedCase(String tableName)
           
 boolean isCorrectDatabaseImplementation(DatabaseConnection conn)
          Is this AbstractDatabase subclass the correct one to use for the given connection.
 boolean isReservedWord(String tableName)
           
 boolean isSystemObject(DatabaseObject example)
           
 boolean supportsCatalogInObjectName(Class<? extends DatabaseObject> type)
           
 boolean supportsInitiallyDeferrableColumns()
          Returns whether this database support initially deferrable columns.
 boolean supportsSequences()
          Does the database type support sequence.
 boolean supportsTablespaces()
           
 
Methods inherited from class liquibase.database.AbstractJdbcDatabase
canCreateChangeLogTable, checkDatabaseChangeLogLockTable, checkDatabaseChangeLogTable, close, commit, correctSchema, correctSchema, createsIndexesForForeignKeys, dataTypeIsNotModifiable, disableForeignKeyChecks, doesTagExist, dropDatabaseObjects, enableForeignKeyChecks, equals, escapeColumnName, escapeColumnNameList, escapeConstraintName, escapeIndexName, escapeObjectName, escapeSequenceName, escapeStringForDatabase, escapeTableName, escapeViewName, execute, executeRollbackStatements, executeStatements, generateDatabaseFunctionValue, generatePrimaryKeyName, getAutoCommitMode, getAutoIncrementByClause, getAutoIncrementClause, getAutoIncrementClosing, getAutoIncrementOpening, getAutoIncrementStartWithClause, getConcatSql, getConnection, getConnectionCatalogName, getContainingObjects, getCurrentDateTimeFunction, getDatabaseMajorVersion, getDatabaseMinorVersion, getDatabaseProductName, getDatabaseProductVersion, getDataTypeMaxParameters, getDateFunctions, getDateLiteral, getDateLiteral, getDateLiteral, getDateTimeLiteral, getDefaultCatalogName, getDefaultSchema, getDefaultSchemaName, getJdbcCatalogName, getJdbcCatalogName, getJdbcSchemaName, getJdbcSchemaName, getLineComment, getLiquibaseCatalogName, getLiquibaseSchemaName, getLiquibaseTablespaceName, getName, getNextChangeSetSequenceValue, getObjectQuotingStrategy, getOutputDefaultCatalog, getOutputDefaultSchema, getRanChangeSet, getRanChangeSetList, getRanDate, getRunStatus, getSchemaFromJdbcInfo, getSystemSchema, getSystemTables, getTimeLiteral, getViewDefinition, hasDatabaseChangeLogLockTable, hasDatabaseChangeLogTable, hashCode, isAutoCommit, isCaseSensitive, isDatabaseChangeLogLockTableInitialized, isDateOnly, isDateTime, isDefaultCatalog, isDefaultSchema, isFunction, isLiquibaseObject, isSafeToRunUpdate, isSystemView, isTimeOnly, jdbcCallsCatalogsSchemas, markChangeSetExecStatus, mustQuoteObjectName, parseDate, quoteObject, removeRanStatus, requiresPassword, requiresUsername, resetInternalState, resetRanChangeSetList, rollback, saveRollbackStatement, saveStatements, setAutoCommit, setCanCacheLiquibaseTableInfo, setConnection, setCurrentDateTimeFunction, setDatabaseChangeLogLockTableName, setDatabaseChangeLogTableName, setDefaultCatalogName, setDefaultSchemaName, setLiquibaseCatalogName, setLiquibaseSchemaName, setLiquibaseTablespaceName, setObjectQuotingStrategy, setOutputDefaultCatalog, setOutputDefaultSchema, startsWithNumeric, supportsAutoIncrement, supportsCatalogs, supportsDDLInTransaction, supportsDropTableCascadeConstraints, supportsForeignKeyDisable, supportsPrimaryKeyNames, supportsRestrictForeignKeys, supportsSchemas, tag, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PRODUCT_NAME

public static final String PRODUCT_NAME
See Also:
Constant Field Values
Constructor Detail

PostgresDatabase

public PostgresDatabase()
Method Detail

getShortName

public String getShortName()
Description copied from interface: Database
Returns an all-lower-case short name of the product. Used for end-user selecting of database type such as the DBMS precondition.


getDefaultDatabaseProductName

protected String getDefaultDatabaseProductName()
Specified by:
getDefaultDatabaseProductName in class AbstractJdbcDatabase

getDefaultPort

public Integer getDefaultPort()

getSystemViews

public Set<String> getSystemViews()
Description copied from class: AbstractJdbcDatabase
Returns system (undroppable) views.

Overrides:
getSystemViews in class AbstractJdbcDatabase

getPriority

public int getPriority()

supportsInitiallyDeferrableColumns

public boolean supportsInitiallyDeferrableColumns()
Description copied from interface: Database
Returns whether this database support initially deferrable columns.


isCorrectDatabaseImplementation

public boolean isCorrectDatabaseImplementation(DatabaseConnection conn)
                                        throws DatabaseException
Description copied from interface: Database
Is this AbstractDatabase subclass the correct one to use for the given connection.

Throws:
DatabaseException

getDefaultDriver

public String getDefaultDriver(String url)
Description copied from interface: Database
If this database understands the given url, return the default driver class name. Otherwise return null.


supportsCatalogInObjectName

public boolean supportsCatalogInObjectName(Class<? extends DatabaseObject> type)
Specified by:
supportsCatalogInObjectName in interface Database
Overrides:
supportsCatalogInObjectName in class AbstractJdbcDatabase

supportsSequences

public boolean supportsSequences()
Description copied from class: AbstractJdbcDatabase
Does the database type support sequence.

Specified by:
supportsSequences in interface Database
Overrides:
supportsSequences in class AbstractJdbcDatabase

getDatabaseChangeLogTableName

public String getDatabaseChangeLogTableName()
Specified by:
getDatabaseChangeLogTableName in interface Database
Overrides:
getDatabaseChangeLogTableName in class AbstractJdbcDatabase
See Also:
Database.getDatabaseChangeLogTableName()

getDatabaseChangeLogLockTableName

public String getDatabaseChangeLogLockTableName()
Specified by:
getDatabaseChangeLogLockTableName in interface Database
Overrides:
getDatabaseChangeLogLockTableName in class AbstractJdbcDatabase
See Also:
Database.getDatabaseChangeLogLockTableName()

isSystemObject

public boolean isSystemObject(DatabaseObject example)
Specified by:
isSystemObject in interface Database
Overrides:
isSystemObject in class AbstractJdbcDatabase

supportsTablespaces

public boolean supportsTablespaces()

getAutoIncrementClause

public String getAutoIncrementClause()
Overrides:
getAutoIncrementClause in class AbstractJdbcDatabase

generateAutoIncrementStartWith

public boolean generateAutoIncrementStartWith(BigInteger startWith)
Overrides:
generateAutoIncrementStartWith in class AbstractJdbcDatabase

generateAutoIncrementBy

public boolean generateAutoIncrementBy(BigInteger incrementBy)
Overrides:
generateAutoIncrementBy in class AbstractJdbcDatabase

escapeObjectName

public String escapeObjectName(String objectName,
                               Class<? extends DatabaseObject> objectType)
Specified by:
escapeObjectName in interface Database
Overrides:
escapeObjectName in class AbstractJdbcDatabase

correctObjectName

public String correctObjectName(String objectName,
                                Class<? extends DatabaseObject> objectType)
Description copied from interface: Database
Fix the object name to the format the database expects, handling changes in case, etc.

Specified by:
correctObjectName in interface Database
Overrides:
correctObjectName in class AbstractJdbcDatabase

hasMixedCase

protected boolean hasMixedCase(String tableName)

isReservedWord

public boolean isReservedWord(String tableName)
Specified by:
isReservedWord in interface Database
Overrides:
isReservedWord in class AbstractJdbcDatabase

getConnectionSchemaName

protected String getConnectionSchemaName()
Description copied from class: AbstractJdbcDatabase
Overwrite this method to get the default schema name for the connection.

Overrides:
getConnectionSchemaName in class AbstractJdbcDatabase
Returns:


Copyright © 2013 Liquibase.org. All Rights Reserved.