public class PostgreSQL extends AbstractSQL
This class acts strictly as the Orchestrator/Facade pattern. All specialized logic has been extracted into highly cohesive, dedicated handler classes:
PostgreSQLCatalogInspector - Database metadata reads (pg_class, information_schema).PostgreSQLExtensionManager - Management of DB extensions (hstore, pg_trgm, btree_gin).PostgreSQLTableMigrator - Core table and column synchronization (CREATE/ALTER).PostgreSQLInheritanceManager - Object-relational inheritance mapping (INHERITS).PostgreSQLIndexSynchronizer - Index parsing, creation, and cleanup.PostgreSQLRelationManager - n-m relation table management.PostgreSQLMigrationContext to prevent leakage
across consecutive migration runs.
Architectural JDBC Best Practices Enforced:
getConn().createStatement()) for ResultSet iterations
to prevent "silent closures" by the JDBC driver.executeSQL() / executeUpdate()
which utilizes the shared defaultStatement for pure DDL operations.| Modifier and Type | Field and Description |
|---|---|
static org.apache.log4j.Logger |
log |
SCOPE_GLOBAL, SCOPE_LOCAL| Constructor and Description |
|---|
PostgreSQL()
Constructs a new PostgreSQL schema generator instance.
|
PostgreSQL(electric.xml.Element e)
Constructs a new PostgreSQL schema generator instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
generateImpl(SchemaI schema)
Executes the schema generation and migration process using the provided schema.
|
void |
generateImpl(SchemaI schema,
SchemaI newSchema)
Core orchestration method for the schema migration process.
|
java.lang.String |
getName()
Returns the human-readable name of this generator.
|
void |
handleAdditionalAttributes(electric.xml.Attribute attr)
Parses generator-specific XML attributes provided during initialization.
|
static java.lang.String |
optimizePostgresConnectionUrl(java.lang.String connUrl)
Optimizes the JDBC connection URL for PostgreSQL to utilize Unix domain sockets
instead of TCP sockets if executed locally on a Linux system.
|
generate, getDriver, getPass, getUrl, getUser, initDatabaseConnectionParameters, setDriver, setPass, setUrl, setUser, shutdownequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgeneratepublic PostgreSQL()
public PostgreSQL(electric.xml.Element e)
e - Optional XML Element containing initial configuration attributes.public static java.lang.String optimizePostgresConnectionUrl(java.lang.String connUrl)
By skipping network layer overhead, this yields significant performance optimizations for local database interaction during heavy schema migration procedures.
connUrl - The standard TCP JDBC URL (e.g. jdbc:postgresql://localhost:5432/db).public void handleAdditionalAttributes(electric.xml.Attribute attr)
attr - The XML attribute to process (e.g. config for index recreation).public java.lang.String getName()
getName in interface CBOGeneratorIgetName in class AbstractSQLpublic void generateImpl(SchemaI schema)
schema - The target schema definition to map to the database.public void generateImpl(SchemaI schema, SchemaI newSchema)
generateImpl in class AbstractSQLschema - The target schema definition.newSchema - An optional new schema.Copyright © 2000-2026 OAshi S.à r.l. All Rights Reserved.