Class PgIndex

All Implemented Interfaces:
IHashable, IOptionContainer, ISearchPath, ISimpleColumnContainer, ISimpleOptionContainer, IStatement

public final class PgIndex extends AbstractIndex
PostgreSQL index implementation. Supports all PostgreSQL index features including unique constraints, partial indexes, expression indexes, and index inheritance for partitioned tables.
  • Constructor Details

    • PgIndex

      public PgIndex(String name)
      Creates a new PostgreSQL index.
      Parameters:
      name - index name
  • Method Details

    • canDrop

      public boolean canDrop()
      Description copied from class: PgStatement
      Checks if this statement can be dropped.
      Overrides:
      canDrop in class PgStatement
      Returns:
      true if the statement can be dropped
    • getCreationSQL

      public void getCreationSQL(SQLScript script)
      Description copied from class: PgStatement
      Generates 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:
      getCreationSQL in class PgStatement
      Parameters:
      script - the SQL script to append creation statements to
    • getQualifiedName

      public String getQualifiedName()
      Description copied from interface: IStatement
      Gets the fully qualified name of this statement.
      Specified by:
      getQualifiedName in interface IStatement
      Overrides:
      getQualifiedName in class PgStatement
      Returns:
      fully qualified (up to schema) dot-delimited object name. Identifiers are quoted.
    • appendAlterSQL

      public ObjectState appendAlterSQL(PgStatement newCondition, SQLScript script)
      Description copied from class: PgStatement
      Fill script with object changes and return change type
      Specified by:
      appendAlterSQL in class PgStatement
      Parameters:
      newCondition - new object state
      script - script to collect changes
      Returns:
      object change type
    • getMethod

      public String getMethod()
      Gets the index access method (btree, hash, gin, gist, etc.).
      Returns:
      index method name
    • setMethod

      public void setMethod(String method)
    • addInherit

      public void addInherit(String schemaName, String indexName)
      Sets the parent index for this partitioned index.
      Parameters:
      schemaName - parent index schema name
      indexName - parent index name
    • setNullsDistinction

      public void setNullsDistinction(boolean nullsDistinction)
    • computeHash

      public void computeHash(Hasher hasher)
      Description copied from interface: IHashable
      Computes the hash of the implementing object using the provided hasher. The implementation should call appropriate put methods on the hasher for all fields that should contribute to the hash value.
      Specified by:
      computeHash in interface IHashable
      Overrides:
      computeHash in class AbstractIndex
      Parameters:
      hasher - the hasher instance to use for hash computation