When generating a ceate statement using a JDBC Stage on a ProstgreSQL database, instead of the expected data types varchar(n)
or text
, the datatype name(n)
is used, so the generated ddl will not function.
The datatype name
(without (n)
) is actually an "internal type for object names but not intended for general-purpose use, only for use in the internal system catalogs", as documented here.
When running the datasatge job, the Connector finds following driver information: The driver name and version are: PostgreSQL JDBC Driver 42.6.0
, The data source name and version are: PostgreSQL 15.3 (15.3)
.
The Job aborts with the message '[SQLSTATE 42601] org.postgresql.util.PSQLException: ERROR: type modifier is not allowed for type "name"', which
I made test job which should create a table and write to it. It generates a ddl for the corresponding DataStage data types, but the it is wrong:
CREATE TABLE
myschema.my_test_table
(
this_is_int int4 NOT NULL,
this_is_char CHAR(10) NOT NULL,
this_is_varchar name(10) NOT NULL, -- should be varchar(10)
this_is_nchar CHAR(10) NOT NULL,
this_is_nvarchar name(10) NOT NULL, -- should be varchar(10)
this_is_LongVarChar name NOT NULL, -- should be text
this_is_LongNVarCHar name NOT NULL -- should be text
)
Is there any JavaVM Parameter (or anything else, a workaround,...) which I can set for the PostgreSQL driver to correct this behaviour?