public class PostgreSQLColumn extends SQLColumn
Handles PostgreSQL dialects, enforces timezone-aware timestamps, and tracks
the previous state (predecessor) of a column during complex ALTER TABLE
migration scenarios.
| Constructor and Description |
|---|
PostgreSQLColumn(java.lang.String name,
CBOAttributeI attr)
Constructs a new PostgreSQL column definition.
|
PostgreSQLColumn(java.lang.String name,
java.lang.String colType)
Constructs a new PostgreSQL column definition with an explicitly forced SQL type.
|
PostgreSQLColumn(java.lang.String name,
java.lang.String colType,
CBOAttributeI attr) |
PostgreSQLColumn(java.lang.String name,
java.lang.String colTypeName,
int colType,
int colSize)
Constructs a new PostgreSQL column directly from JDBC metadata.
|
| Modifier and Type | Method and Description |
|---|---|
SQLColumn |
getPredecessor() |
boolean |
isEmpty(java.sql.Statement statement,
java.lang.String tableName)
Determines if the actual physical database column currently contains no data.
|
java.lang.String |
normalizeColumnType(java.lang.String typeName,
int columnType,
int columnWidth)
Normalizes raw database types into standard schema types, applying PostgreSQL specifics.
|
void |
setPredecessor(SQLColumn $2) |
equals, getAttribute, getColtype, getCreateStatement, getName, setAttribute, setColtype, setName, toStringpublic PostgreSQLColumn(java.lang.String name,
CBOAttributeI attr)
name - The logical column name.attr - The underlying schema attribute definition.public PostgreSQLColumn(java.lang.String name,
java.lang.String colType)
name - The logical column name.colType - The explicit PostgreSQL type string (e.g. 'hstore').attr - The underlying schema attribute definition (can be null).public PostgreSQLColumn(java.lang.String name,
java.lang.String colType,
CBOAttributeI attr)
public PostgreSQLColumn(java.lang.String name,
java.lang.String colTypeName,
int colType,
int colSize)
public java.lang.String normalizeColumnType(java.lang.String typeName,
int columnType,
int columnWidth)
Dialect Enforcement: Forces all timestamps to timestamptz to ensure
timezone correctness natively within the database engine.
normalizeColumnType in interface SQLColumnInormalizeColumnType in class SQLColumntypeName - The raw PostgreSQL type name.columnType - The java.sql.Types integer representation.columnWidth - The column width.public boolean isEmpty(java.sql.Statement statement,
java.lang.String tableName)
This is highly optimized by executing a SELECT ... LIMIT 1 query. It is
utilized during schema migration to decide whether a complex data type conversion
is necessary, or if the column can simply be dropped and cleanly recreated.
Security: Table and column names are safely quoted via PostgreSQLDDLBuilder.
statement - The JDBC statement used to execute the check.tableName - The name of the table containing the column.java.lang.IllegalStateException - if a database error prevents the emptiness check.public SQLColumn getPredecessor()
public void setPredecessor(SQLColumn $2)
Copyright © 2000-2026 OAshi S.à r.l. All Rights Reserved.