public final class PgCreateDomain extends PgParserAbstract
Parser for PostgreSQL CREATE DOMAIN statements.

This class handles parsing of domain definitions including the underlying data type, default values, check constraints, collation, and null constraints. Domains are user-defined data types based on existing types with additional constraints and default values.

  • Constructor Details

    • PgCreateDomain

      public PgCreateDomain(SQLParser.Create_domain_statementContext ctx, PgDatabase db, org.antlr.v4.runtime.CommonTokenStream stream, ISettings settings)
      Constructs a new CreateDomain parser.
      Parameters:
      ctx - the CREATE DOMAIN statement context
      db - the PostgreSQL database object
      stream - the token stream for parsing
      settings - the ISettings object
  • Method Details

    • parseObject

      public void parseObject()
      Description copied from class: ParserAbstract
      Parses a database object from the current context. Must be implemented by concrete subclasses to handle specific object types.
      Specified by:
      parseObject in class ParserAbstract<PgDatabase>
    • parseDomainConstraint

      public static void parseDomainConstraint(PgDomain domain, PgConstraintCheck constr, SQLParser.Domain_constraintContext ctx, IDatabase db, String location, ISettings settings)
      Parses a domain constraint definition and configures the constraint object.

      This method processes CHECK constraints for domains, including the constraint expression and sets up analysis launchers for dependency tracking.

      Parameters:
      domain - the domain object that owns the constraint
      constr - the constraint object to configure
      ctx - the domain constraint context
      db - the database for analysis launchers
      location - the source location for error reporting
      settings - the parser settings