Class AbstractPostgresDatabase
- All Implemented Interfaces:
AutoCloseable,Database,PrioritizedService
- Direct Known Subclasses:
PostgresDatabase
This is phase 1 of INT-2139 (the Postgres-family inheritance refactor) and is deliberately
behavior-neutral: PostgresDatabase extends this class and no variant is
reparented yet, so the runtime type hierarchy is unchanged.
What intentionally stays in PostgresDatabase (real-Postgres-specific, and
candidates for the explicit-capability work in the next story rather than for moving here):
sequences, SERIAL / GENERATED ... AS IDENTITY auto-increment, tablespaces, initially
deferrable columns, changelog-history support, CREATE ... IF NOT EXISTS, the product
name / minimum-version identity check, the default driver and port, and the search-path reset on
rollback. These are exactly the features the variants do not share, so they must become
opt-in capability methods, not inherited defaults.
-
Field Summary
Fields inherited from class liquibase.database.AbstractJdbcDatabase
caseSensitive, currentDateTimeFunction, dateFunctions, defaultAutoIncrementBy, defaultAutoIncrementStartWith, defaultCatalogName, defaultSchemaName, quotingStrategy, sequenceCurrentValueFunction, sequenceNextValueFunction, unmodifiableDataTypes, unquotedObjectsAreUppercasedFields inherited from interface liquibase.database.Database
COMPLETE_SQL_SCOPE_KEY, IGNORE_MISSING_REFERENCES_KEYFields inherited from interface liquibase.servicelocator.PrioritizedService
COMPARATOR, PRIORITY_DATABASE, PRIORITY_DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncorrectObjectName(String objectName, Class<? extends DatabaseObject> objectType) Fix the object name to the format the database expects, handling changes in case, etc.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.protected SqlStatementUsed to obtain the connection schema name through a statement Override this method to change the statement.This logic is used when db support catalogsReturns system (undroppable) views.protected booleanhasMixedCase(String tableName) booleanisReservedWord(String tableName) booleanisSystemObject(DatabaseObject example) voidsetDefaultCatalogName(String defaultCatalogName) booleansupportsCatalogInObjectName(Class<? extends DatabaseObject> type) booleanWhether check constraints on this database can be read by the standard check-constraint snapshot service.booleanWhether PostgreSQL-style composite types (CREATE TYPE ... AS (...)) on this database can be read by the standard composite-type snapshot generator.booleanWhether PostgreSQL-style enumerated types (CREATE TYPE ... AS ENUM (...)) on this database can be read by the standard enum-type snapshot generator.booleanWhether stored database logic (functions, procedures, packages, triggers) can be snapshotted from this database via the standard stored-logic snapshot generators.unescapeDataTypeName(String dataTypeName) booleanMethods inherited from class liquibase.database.AbstractJdbcDatabase
addReservedWords, canCreateChangeLogTable, close, commit, correctSchema, correctSchema, createsIndexesForForeignKeys, dataTypeIsNotModifiable, disableForeignKeyChecks, doesTagExist, dropDatabaseObjects, enableForeignKeyChecks, equals, escapeColumnName, escapeColumnName, escapeColumnNameList, escapeConstraintName, escapeDataTypeName, escapeIndexName, escapeObjectName, escapeSequenceName, escapeStringForDatabase, escapeTableName, escapeViewName, execute, executeRollbackStatements, executeRollbackStatements, executeStatements, filterRollbackVisitors, generateAutoIncrementBy, generateAutoIncrementStartWith, generateDatabaseFunctionValue, generatePrimaryKeyName, get, getAutoCommitMode, getAutoIncrementByClause, getAutoIncrementClause, getAutoIncrementClause, getAutoIncrementClause, getAutoIncrementClosing, getAutoIncrementOpening, getAutoIncrementStartWithClause, getConcatSql, getConnection, getConnectionCatalogName, getConnectionSchemaName, getContainingObjects, getCurrentDateTimeFunction, getDatabaseMajorVersion, getDatabaseMinorVersion, getDatabaseProductName, getDatabaseProductVersion, getDataTypeMaxParameters, getDateFunctions, getDateLiteral, getDateLiteral, getDateLiteral, getDateTimeLiteral, getDefaultCatalogName, getDefaultDatabaseProductName, getDefaultFractionalDigitsForTimestamp, getDefaultScaleForNativeDataType, getDefaultSchema, getDefaultSchemaName, getFetchSize, getJdbcCatalogName, getJdbcCatalogName, getJdbcSchemaName, getJdbcSchemaName, getLineComment, getLiquibaseCatalogName, getLiquibaseSchemaName, getLiquibaseTablespaceName, getMaxFractionalDigitsForTimestamp, getName, getObjectQuotingStrategy, getOutputDefaultCatalog, getOutputDefaultSchema, getQuotingEndCharacter, getQuotingEndReplacement, getQuotingStartCharacter, getRanChangeSet, getRanChangeSetList, getRanDate, getRawDatabaseChangeLogLockTableName, getRawDatabaseChangeLogTableName, getRunStatus, getSchemaFromJdbcInfo, getSystemSchema, getSystemTables, getTimeLiteral, getViewDefinition, hashCode, isAutoCommit, isCaseSensitive, isCatalogOrSchemaType, isCurrentTimeFunction, 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, setConnection, setCurrentDateTimeFunction, setDatabaseChangeLogLockTableName, setDatabaseChangeLogTableName, setDefaultSchemaName, setLiquibaseCatalogName, setLiquibaseSchemaName, setLiquibaseTablespaceName, setObjectQuotingStrategy, setOutputDefaultCatalog, setOutputDefaultSchema, setPreviousAutoCommit, startsWithNumeric, supportsAutoIncrement, supportsBatchUpdates, supportsCatalogs, supportsDDLInTransaction, supportsDropTableCascadeConstraints, supportsForeignKeyDisable, supportsNotNullConstraintNames, supportsPrimaryKeyNames, supportsRestrictForeignKeys, supportsSchemas, supportsSequences, tag, toString, unescapeDataTypeString, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface liquibase.database.Database
addCompleteSqlToScope, afterUpdate, checkDatabaseConnection, dropDatabaseObjects, escapeForLike, escapeTablespaceName, failOnDefferable, generateConnectCommandSuccessMessage, getDefaultDriver, getDefaultPort, getDisplayName, getShortName, isCorrectDatabaseImplementation, supports, supportsCreateIfNotExists, supportsDatabaseChangeLogHistory, supportsInitiallyDeferrableColumns, supportsTablespaces, temporarilySetObjectQuotingStrategyMethods inherited from interface liquibase.servicelocator.PrioritizedService
getPriority
-
Constructor Details
-
AbstractPostgresDatabase
protected AbstractPostgresDatabase()
-
-
Method Details
-
getSystemViews
Description copied from class:AbstractJdbcDatabaseReturns system (undroppable) views.- Overrides:
getSystemViewsin classAbstractJdbcDatabase
-
supportsCatalogInObjectName
- Specified by:
supportsCatalogInObjectNamein interfaceDatabase- Overrides:
supportsCatalogInObjectNamein classAbstractJdbcDatabase
-
getDatabaseChangeLogTableName
- Specified by:
getDatabaseChangeLogTableNamein interfaceDatabase- Overrides:
getDatabaseChangeLogTableNamein classAbstractJdbcDatabase
-
getDatabaseChangeLogLockTableName
- Specified by:
getDatabaseChangeLogLockTableNamein interfaceDatabase- Overrides:
getDatabaseChangeLogLockTableNamein classAbstractJdbcDatabase
-
unescapeDataTypeName
- Specified by:
unescapeDataTypeNamein interfaceDatabase- Overrides:
unescapeDataTypeNamein classAbstractJdbcDatabase
-
isSystemObject
- Specified by:
isSystemObjectin interfaceDatabase- Overrides:
isSystemObjectin classAbstractJdbcDatabase
-
escapeObjectName
This has special case logic to handle NOT quoting column names if they are of type 'LiquibaseColumn' - columns in the DATABASECHANGELOG or DATABASECHANGELOGLOCK tables.- Specified by:
escapeObjectNamein interfaceDatabase- Overrides:
escapeObjectNamein classAbstractJdbcDatabase
-
correctObjectName
Description copied from interface:DatabaseFix the object name to the format the database expects, handling changes in case, etc.- Specified by:
correctObjectNamein interfaceDatabase- Overrides:
correctObjectNamein classAbstractJdbcDatabase
-
hasMixedCase
-
isReservedWord
- Specified by:
isReservedWordin interfaceDatabase- Overrides:
isReservedWordin classAbstractJdbcDatabase
-
getConnectionSchemaNameCallStatement
Description copied from class:AbstractJdbcDatabaseUsed to obtain the connection schema name through a statement Override this method to change the statement. Only override this if getConnectionSchemaName is left unchanged or is using this method.- Overrides:
getConnectionSchemaNameCallStatementin classAbstractJdbcDatabase- See Also:
-
getSchemaAndCatalogCase
Description copied from class:AbstractJdbcDatabaseThis logic is used when db support catalogs- Specified by:
getSchemaAndCatalogCasein interfaceDatabase- Overrides:
getSchemaAndCatalogCasein classAbstractJdbcDatabase- Returns:
- UPPER_CASE by default
-
setDefaultCatalogName
- Specified by:
setDefaultCatalogNamein interfaceDatabase- Overrides:
setDefaultCatalogNamein classAbstractJdbcDatabase
-
useSerialDatatypes
public boolean useSerialDatatypes() -
supportsEnumTypeSnapshot
public boolean supportsEnumTypeSnapshot()Whether PostgreSQL-style enumerated types (CREATE TYPE ... AS ENUM (...)) on this database can be read by the standard enum-type snapshot generator. Named for snapshot-ability, not raw SQL capability.- Returns:
- true if enum types on this database are snapshot-able via the standard generator
-
supportsCompositeTypeSnapshot
public boolean supportsCompositeTypeSnapshot()Whether PostgreSQL-style composite types (CREATE TYPE ... AS (...)) on this database can be read by the standard composite-type snapshot generator. Named for snapshot-ability, not raw SQL capability: a variant may accept the DDL yet returnfalsehere because the standard generator cannot read its catalog.- Returns:
- true if composite types on this database are snapshot-able via the standard generator
-
supportsCheckConstraintSnapshot
public boolean supportsCheckConstraintSnapshot()Whether check constraints on this database can be read by the standard check-constraint snapshot service. Named for snapshot-ability, not enforcement: e.g. Redshift acceptsCHECKin DDL but never enforces it and exposes no usable catalog for it, so it returnsfalse. (Cross-family concept; non-Postgres families still gate viainstanceofinStandardCheckConstraintServiceuntil the 6.1+ sweep.)- Returns:
- true if check constraints on this database are snapshot-able via the standard service
-
supportsStoredLogicSnapshot
public boolean supportsStoredLogicSnapshot()Whether stored database logic (functions, procedures, packages, triggers) can be snapshotted from this database via the standard stored-logic snapshot generators. (Cross-family concept; non-Postgres families still gate viainstanceofuntil the 6.1+ sweep.)- Returns:
- true if stored logic on this database is snapshot-able via the standard generators
-