public class PostgresDatabase extends AbstractJdbcDatabase
Modifier and Type | Class and Description |
---|---|
static class |
PostgresDatabase.DbTypes
Represents Postgres DB types.
|
Modifier and Type | Field and Description |
---|---|
static int |
MINIMUM_DBMS_MAJOR_VERSION |
static int |
MINIMUM_DBMS_MINOR_VERSION |
static String |
PRODUCT_NAME |
caseSensitive, currentDateTimeFunction, dateFunctions, defaultAutoIncrementBy, defaultAutoIncrementStartWith, defaultCatalogName, defaultSchemaName, quotingStrategy, sequenceCurrentValueFunction, sequenceNextValueFunction, unmodifiableDataTypes, unquotedObjectsAreUppercased
COMPARATOR, PRIORITY_DATABASE, PRIORITY_DEFAULT
Constructor and Description |
---|
PostgresDatabase() |
Modifier and Type | Method and Description |
---|---|
String |
correctObjectName(String objectName,
Class<? extends DatabaseObject> objectType)
Fix the object name to the format the database expects, handling changes in case, etc.
|
boolean |
equals(Object o) |
String |
escapeObjectName(String objectName,
Class<? extends DatabaseObject> objectType)
This has special case logic to handle NOT quoting column names if they are
of type 'LiquibaseColumn' - columns in the DATABASECHANGELOG or DATABASECHANGELOGLOCK
tables.
|
boolean |
generateAutoIncrementBy(BigInteger incrementBy) |
boolean |
generateAutoIncrementStartWith(BigInteger startWith) |
String |
generatePrimaryKeyName(String tableName) |
String |
getAutoIncrementClause() |
protected SqlStatement |
getConnectionSchemaNameCallStatement()
Used to obtain the connection schema name through a statement
Override this method to change the statement.
|
String |
getDatabaseChangeLogLockTableName() |
String |
getDatabaseChangeLogTableName() |
String |
getDatabaseFullVersion() |
PostgresDatabase.DbTypes |
getDbType()
Method to get Postgres DB type
|
protected String |
getDefaultDatabaseProductName() |
String |
getDefaultDriver(String url)
If this database understands the given url, return the default driver class name.
|
Integer |
getDefaultPort() |
int |
getMaxFractionalDigitsForTimestamp()
Most relational databases support 9 fractional digits, and subclasses must overwrite this method if they
support less than that.
|
int |
getPriority() |
CatalogAndSchema.CatalogAndSchemaCase |
getSchemaAndCatalogCase()
This logic is used when db support catalogs
|
String |
getShortName()
Returns an all-lower-case short name of the product.
|
Set<String> |
getSystemViews()
Returns system (undroppable) views.
|
int |
hashCode() |
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) |
void |
setConnection(DatabaseConnection conn) |
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() |
String |
unescapeDataTypeName(String dataTypeName) |
addReservedWords, canCreateChangeLogTable, close, commit, correctSchema, correctSchema, createsIndexesForForeignKeys, dataTypeIsNotModifiable, disableForeignKeyChecks, doesTagExist, dropDatabaseObjects, enableForeignKeyChecks, escapeColumnName, escapeColumnName, escapeColumnNameList, escapeConstraintName, escapeDataTypeName, escapeIndexName, escapeObjectName, escapeSequenceName, escapeStringForDatabase, escapeTableName, escapeViewName, execute, executeRollbackStatements, executeRollbackStatements, executeStatements, filterRollbackVisitors, generateDatabaseFunctionValue, get, getAutoCommitMode, getAutoIncrementByClause, getAutoIncrementClause, getAutoIncrementClause, getAutoIncrementClosing, getAutoIncrementOpening, getAutoIncrementStartWithClause, getConcatSql, getConnection, getConnectionCatalogName, getConnectionSchemaName, getContainingObjects, getCurrentDateTimeFunction, getDatabaseMajorVersion, getDatabaseMinorVersion, getDatabaseProductName, getDatabaseProductVersion, getDataTypeMaxParameters, getDateFunctions, getDateLiteral, getDateLiteral, getDateLiteral, getDateTimeLiteral, getDefaultCatalogName, getDefaultFractionalDigitsForTimestamp, getDefaultScaleForNativeDataType, getDefaultSchema, getDefaultSchemaName, getFetchSize, getJdbcCatalogName, getJdbcCatalogName, getJdbcSchemaName, getJdbcSchemaName, getLineComment, getLiquibaseCatalogName, getLiquibaseSchemaName, getLiquibaseTablespaceName, getName, getObjectQuotingStrategy, getOutputDefaultCatalog, getOutputDefaultSchema, getQuotingEndCharacter, getQuotingEndReplacement, getQuotingStartCharacter, getRanChangeSet, getRanChangeSetList, getRanDate, getRunStatus, getSchemaFromJdbcInfo, getSystemSchema, getSystemTables, getTimeLiteral, getViewDefinition, isAutoCommit, isCaseSensitive, isDateOnly, isDateTime, isDefaultCatalog, isDefaultSchema, isFunction, isLiquibaseObject, isSafeToRunUpdate, isSystemView, isTimeOnly, isTimestamp, jdbcCallsCatalogsSchemas, markChangeSetExecStatus, mustQuoteObjectName, parseDate, quoteObject, removeRanStatus, requiresExplicitNullForColumns, requiresPassword, requiresUsername, resetInternalState, rollback, saveRollbackStatement, saveStatements, set, setAutoCommit, setCanCacheLiquibaseTableInfo, setCaseSensitive, setCurrentDateTimeFunction, setDatabaseChangeLogLockTableName, setDatabaseChangeLogTableName, setDefaultCatalogName, setDefaultSchemaName, setLiquibaseCatalogName, setLiquibaseSchemaName, setLiquibaseTablespaceName, setObjectQuotingStrategy, setOutputDefaultCatalog, setOutputDefaultSchema, startsWithNumeric, supportsAutoIncrement, supportsBatchUpdates, supportsCatalogs, supportsDDLInTransaction, supportsDropTableCascadeConstraints, supportsForeignKeyDisable, supportsNotNullConstraintNames, supportsPrimaryKeyNames, supportsRestrictForeignKeys, supportsSchemas, tag, toString, unescapeDataTypeString, validate
public static final String PRODUCT_NAME
public static final int MINIMUM_DBMS_MAJOR_VERSION
public static final int MINIMUM_DBMS_MINOR_VERSION
public boolean equals(Object o)
equals
in class AbstractJdbcDatabase
public int hashCode()
hashCode
in class AbstractJdbcDatabase
public String getShortName()
Database
protected String getDefaultDatabaseProductName()
getDefaultDatabaseProductName
in class AbstractJdbcDatabase
public Integer getDefaultPort()
public Set<String> getSystemViews()
AbstractJdbcDatabase
getSystemViews
in class AbstractJdbcDatabase
public int getPriority()
public boolean supportsInitiallyDeferrableColumns()
Database
public boolean isCorrectDatabaseImplementation(DatabaseConnection conn) throws DatabaseException
Database
DatabaseException
public String getDefaultDriver(String url)
Database
public boolean supportsCatalogInObjectName(Class<? extends DatabaseObject> type)
supportsCatalogInObjectName
in interface Database
supportsCatalogInObjectName
in class AbstractJdbcDatabase
public boolean supportsSequences()
AbstractJdbcDatabase
supportsSequences
in interface Database
supportsSequences
in class AbstractJdbcDatabase
public String getDatabaseChangeLogTableName()
getDatabaseChangeLogTableName
in interface Database
getDatabaseChangeLogTableName
in class AbstractJdbcDatabase
public String getDatabaseChangeLogLockTableName()
getDatabaseChangeLogLockTableName
in interface Database
getDatabaseChangeLogLockTableName
in class AbstractJdbcDatabase
public void setConnection(DatabaseConnection conn)
setConnection
in interface Database
setConnection
in class AbstractJdbcDatabase
public String unescapeDataTypeName(String dataTypeName)
unescapeDataTypeName
in interface Database
unescapeDataTypeName
in class AbstractJdbcDatabase
public boolean isSystemObject(DatabaseObject example)
isSystemObject
in interface Database
isSystemObject
in class AbstractJdbcDatabase
public boolean supportsTablespaces()
public String getAutoIncrementClause()
getAutoIncrementClause
in class AbstractJdbcDatabase
public boolean generateAutoIncrementStartWith(BigInteger startWith)
generateAutoIncrementStartWith
in class AbstractJdbcDatabase
public boolean generateAutoIncrementBy(BigInteger incrementBy)
generateAutoIncrementBy
in class AbstractJdbcDatabase
public String escapeObjectName(String objectName, Class<? extends DatabaseObject> objectType)
escapeObjectName
in interface Database
escapeObjectName
in class AbstractJdbcDatabase
public String correctObjectName(String objectName, Class<? extends DatabaseObject> objectType)
Database
correctObjectName
in interface Database
correctObjectName
in class AbstractJdbcDatabase
protected boolean hasMixedCase(String tableName)
public boolean isReservedWord(String tableName)
isReservedWord
in interface Database
isReservedWord
in class AbstractJdbcDatabase
protected SqlStatement getConnectionSchemaNameCallStatement()
AbstractJdbcDatabase
getConnectionSchemaNameCallStatement
in class AbstractJdbcDatabase
AbstractJdbcDatabase.getConnectionSchemaName()
public String generatePrimaryKeyName(String tableName)
generatePrimaryKeyName
in interface Database
generatePrimaryKeyName
in class AbstractJdbcDatabase
public int getMaxFractionalDigitsForTimestamp()
AbstractJdbcDatabase
getMaxFractionalDigitsForTimestamp
in interface Database
getMaxFractionalDigitsForTimestamp
in class AbstractJdbcDatabase
public CatalogAndSchema.CatalogAndSchemaCase getSchemaAndCatalogCase()
AbstractJdbcDatabase
getSchemaAndCatalogCase
in interface Database
getSchemaAndCatalogCase
in class AbstractJdbcDatabase
public String getDatabaseFullVersion() throws DatabaseException
DatabaseException
public PostgresDatabase.DbTypes getDbType()
Copyright © 2019 Liquibase.org. All rights reserved.