Package org.pgcodekeeper.core.schema.pg
Class PgIndex
java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.AbstractIndex
org.pgcodekeeper.core.schema.pg.PgIndex
- All Implemented Interfaces:
IHashable,IOptionContainer,ISearchPath,ISimpleColumnContainer,ISimpleOptionContainer,IStatement
PostgreSQL index implementation.
Supports all PostgreSQL index features including unique constraints,
partial indexes, expression indexes, and index inheritance for partitioned tables.
-
Field Summary
Fields inherited from class org.pgcodekeeper.core.schema.PgStatement
GOFields inherited from interface org.pgcodekeeper.core.schema.IOptionContainer
GP_OPTION_LIST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInherit(String schemaName, String indexName) Sets the parent index for this partitioned index.appendAlterSQL(PgStatement newCondition, SQLScript script) Fill script with object changes and return change typebooleancanDrop()Checks if this statement can be dropped.voidcomputeHash(Hasher hasher) Computes the hash of the implementing object using the provided hasher.voidgetCreationSQL(SQLScript script) Generates the SQL statements needed to create this database object.Gets the index access method (btree, hash, gin, gist, etc.).Gets the fully qualified name of this statement.voidvoidsetNullsDistinction(boolean nullsDistinction) Methods inherited from class org.pgcodekeeper.core.schema.AbstractIndex
addColumn, addInclude, addOption, compare, compareColumns, getContainingSchema, getOptions, getStatementType, getTablespace, isSubElement, isUnique, setClustered, setTablespace, setUnique, setWhere, shallowCopyMethods inherited from class org.pgcodekeeper.core.schema.PgStatement
addAllDeps, addDep, addPrivilege, appendAlterComments, appendComments, appendOwnerSQL, canDropBeforeCreate, checkComments, clearPrivileges, compareChildren, deepCopy, equals, getAuthor, getBareName, getChildren, getComment, getDbType, getDeps, getDescendants, getDropSQL, getDropSQL, getLibName, getLocation, getName, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getSQL, getTwin, getTypeName, hasChildren, hashCode, isLib, isOwned, setAuthor, setComment, setLibName, setLocation, setOwner, setParent, toStringMethods inherited from interface org.pgcodekeeper.core.schema.ISearchPath
getDatabase, getSchemaNameMethods inherited from interface org.pgcodekeeper.core.schema.ISimpleOptionContainer
appendOptions, compareOptionsMethods inherited from interface org.pgcodekeeper.core.schema.IStatement
getBareName, getComment, getName, getParent
-
Constructor Details
-
PgIndex
Creates a new PostgreSQL index.- Parameters:
name- index name
-
-
Method Details
-
canDrop
public boolean canDrop()Description copied from class:PgStatementChecks if this statement can be dropped.- Overrides:
canDropin classPgStatement- Returns:
- true if the statement can be dropped
-
getCreationSQL
Description copied from class:PgStatementGenerates the SQL statements needed to create this database object. This is an abstract method that must be implemented by subclasses to provide the specific CREATE SQL for each object type.- Specified by:
getCreationSQLin classPgStatement- Parameters:
script- the SQL script to append creation statements to
-
getQualifiedName
Description copied from interface:IStatementGets the fully qualified name of this statement.- Specified by:
getQualifiedNamein interfaceIStatement- Overrides:
getQualifiedNamein classPgStatement- Returns:
- fully qualified (up to schema) dot-delimited object name. Identifiers are quoted.
-
appendAlterSQL
Description copied from class:PgStatementFill script with object changes and return change type- Specified by:
appendAlterSQLin classPgStatement- Parameters:
newCondition- new object statescript- script to collect changes- Returns:
- object change type
-
getMethod
Gets the index access method (btree, hash, gin, gist, etc.).- Returns:
- index method name
-
setMethod
-
addInherit
Sets the parent index for this partitioned index.- Parameters:
schemaName- parent index schema nameindexName- parent index name
-
setNullsDistinction
public void setNullsDistinction(boolean nullsDistinction) -
computeHash
Description copied from interface:IHashableComputes the hash of the implementing object using the provided hasher. The implementation should call appropriateputmethods on the hasher for all fields that should contribute to the hash value.- Specified by:
computeHashin interfaceIHashable- Overrides:
computeHashin classAbstractIndex- Parameters:
hasher- the hasher instance to use for hash computation
-