Class PgDatabase

All Implemented Interfaces:
IHashable, IDatabase, IStatement, IStatementContainer

public final class PgDatabase extends AbstractDatabase
PostgreSQL database implementation. Manages database-level objects such as schemas, extensions, event triggers, foreign data wrappers, servers, user mappings, and casts.
Author:
fordfrog
  • Constructor Details

    • PgDatabase

      public PgDatabase()
      Creates a new PostgreSQL database.
  • Method Details

    • getChild

      public PgStatement getChild(String name, DbObjType type)
      Description copied from interface: IStatementContainer
      Gets a child statement by name and type.
      Parameters:
      name - the name of the child to find
      type - the type of the child to find
      Returns:
      the child statement, or null if not found
    • addChild

      public void addChild(IStatement st)
      Description copied from interface: IStatementContainer
      Adds a child statement to this container.
      Parameters:
      st - the child statement to add
    • getExtension

      public PgExtension getExtension(String name)
      Returns extension of given name or null if the extension has not been found.
      Parameters:
      name - extension name
      Returns:
      found extension or null
    • getEventTrigger

      public PgEventTrigger getEventTrigger(String name)
    • getForeignDW

      public PgForeignDataWrapper getForeignDW(String name)
      Returns foreign data wrapper of given name or null if the foreign data wrapper has not been found.
      Parameters:
      name - foreign data wrapper name
      Returns:
      found foreign data wrapper or null
    • getServer

      public PgServer getServer(String name)
    • getCast

      public PgCast getCast(String name)
      Returns cast of given name or null if the cast has not been found.
      Parameters:
      name - cast name
      Returns:
      found cast or null
    • compareChildren

      public boolean compareChildren(PgStatement obj)
      Description copied from class: PgStatement
      Deep part of PgStatement.equals(Object). Compares all object's child PgStatements for equality.
      Overrides:
      compareChildren in class AbstractDatabase
    • computeChildrenHash

      public void computeChildrenHash(Hasher hasher)
      Overrides:
      computeChildrenHash in class AbstractDatabase
    • sortColumns

      public void sortColumns()
      Sorts columns in all tables within all schemas of this database. This is used to ensure consistent column ordering in inherited tables.