ok so now its encoding ok, but there is a more fundamental issue.
'text' field types are being stored as varchar in the xml def, but its not
remapping it back to a 'text' type when it goes to recreate the tables -
so it breaks, badly.
also I have noticed that it creates the database with just the LATIN
characterset, but the source db was UNICODE. Is there an undocumented
option to specify a character encoding for the database? should that be
stored with the schema/or even the data?
The TIMESTAMP types are also not as they started.
[ddlToDatabase] WARNING: SQL Command CREATE TABLE "xmldata"
[ddlToDatabase] (
[ddlToDatabase] "chunkid" BIGINT NOT NULL,
[ddlToDatabase] "categoryid" BIGINT NOT NULL,
[ddlToDatabase] "chunkname" VARCHAR(200),
[ddlToDatabase] "chunk" VARCHAR(2147483647), <---------- this should be a
TEXT field type in Postgres.
[ddlToDatabase] "title" VARCHAR(200),
[ddlToDatabase] "published" BOOLEAN,
[ddlToDatabase] "currentowner" BIGINT,
[ddlToDatabase] "modifieddate" TIMESTAMP,
[ddlToDatabase] "creationdate" TIMESTAMP,
[ddlToDatabase] "creator" BIGINT,
[ddlToDatabase] "sortorder" BIGINT,
[ddlToDatabase] "maxclearance" BIGINT,
[ddlToDatabase] "type" VARCHAR,
[ddlToDatabase] PRIMARY KEY ("chunkid")
[ddlToDatabase] ) failed with: ERROR: length for type varchar cannot exceed
10485760
[ddlToDatabase] 13/04/2006 11:27:04
org.apache.ddlutils.platform.PlatformImplBase evaluateBatch
this is the original table in Postgres:
Table "public.xmldata"
Column | Type | Modifiers
--------------+--------------------------+-----------
chunkid | bigint | not null
categoryid | bigint | not null
chunkname | character varying(200) |
chunk | text |
title | character varying(200) |
published | boolean |
currentowner | bigint |
modifieddate | timestamp with time zone |
creationdate | timestamp with time zone |
creator | bigint |
sortorder | bigint |
maxclearance | bigint |
type | character varying |
Indexes:
"aaaaaxmldata_pk" primary key, btree (chunkid)
"datacatagorytreexmldata" btree (categoryid)
"xmldatacatagory" btree (categoryid)
Triggers:
"RI_ConstraintTrigger_23521" AFTER DELETE ON xmldata FROM documentimages NOT
DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE
"RI_FKey_noaction_del"('fk__temporary__chunk__3bffe745', 'documentimages', 'xmldata',
'UNSPECIFIED', 'chunkid', 'chunkid')
"RI_ConstraintTrigger_23522" AFTER UPDATE ON xmldata FROM documentimages NOT
DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE
"RI_FKey_noaction_upd"('fk__temporary__chunk__3bffe745', 'documentimages', 'xmldata',
'UNSPECIFIED', 'chunkid', 'chunkid')
"RI_ConstraintTrigger_23524" AFTER DELETE ON xmldata FROM documentstore NOT
DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE
"RI_FKey_noaction_del"('fk__temporary__chunk__3d2915a8', 'documentstore', 'xmldata',
'UNSPECIFIED', 'chunkid', 'chunkid')
"RI_ConstraintTrigger_23525" AFTER UPDATE ON xmldata FROM documentstore NOT
DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE
"RI_FKey_noaction_upd"('fk__temporary__chunk__3d2915a8', 'documentstore', 'xmldata',
'UNSPECIFIED', 'chunkid', 'chunkid')
"RI_ConstraintTrigger_23527" AFTER DELETE ON xmldata FROM filepermissions NOT
DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE
"RI_FKey_noaction_del"('fk__temporary__chunk__40058253', 'filepermissions', 'xmldata',
'UNSPECIFIED', 'chunkid', 'chunkid')
"RI_ConstraintTrigger_23528" AFTER UPDATE ON xmldata FROM filepermissions NOT
DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE
"RI_FKey_noaction_upd"('fk__temporary__chunk__40058253', 'filepermissions', 'xmldata',
'UNSPECIFIED', 'chunkid', 'chunkid')
"RI_ConstraintTrigger_23656" AFTER DELETE ON xmldata FROM xmlcontent NOT DEFERRABLE
INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE
"RI_FKey_noaction_del"('fk__temporary__chunk__39237a9a', 'xmlcontent', 'xmldata',
'UNSPECIFIED', 'chunkid', 'chunkid')
"RI_ConstraintTrigger_23657" AFTER UPDATE ON xmldata FROM xmlcontent NOT DEFERRABLE
INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE
"RI_FKey_noaction_upd"('fk__temporary__chunk__39237a9a', 'xmlcontent', 'xmldata',
'UNSPECIFIED', 'chunkid', 'chunkid')
"RI_ConstraintTrigger_23661" AFTER INSERT OR UPDATE ON xmldata FROM datacatagorytree
NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE
"RI_FKey_check_ins"('fk__temporary__categ__3a4ca8fd', 'xmldata', 'datacatagorytree',
'UNSPECIFIED', 'categoryid', 'categoryid')
this is the ddlutils XML for this table:
<table name="xmldata">
<column name="chunkid" primaryKey="true" required="true" type="BIGINT" size="19"
autoIncrement="false"/>
<column name="categoryid" primaryKey="false" required="true" type="BIGINT" size="19"
autoIncrement="false"/>
<column name="chunkname" primaryKey="false" required="false" type="VARCHAR" size="200"
autoIncrement="false"/>
<column name="chunk" primaryKey="false" required="false" type="VARCHAR"
size="2147483647" autoIncrement="false"/>
<column name="title" primaryKey="false" required="false" type="VARCHAR" size="200"
autoIncrement="false"/>
<column name="published" primaryKey="false" required="false" type="BIT" size="1"
autoIncrement="false"/>
<column name="currentowner" primaryKey="false" required="false" type="BIGINT"
size="19" autoIncrement="false"/>
<column name="modifieddate" primaryKey="false" required="false" type="TIMESTAMP"
size="35" autoIncrement="false"/>
<column name="creationdate" primaryKey="false" required="false" type="TIMESTAMP"
size="35" autoIncrement="false"/>
<column name="creator" primaryKey="false" required="false" type="BIGINT" size="19"
autoIncrement="false"/>
<column name="sortorder" primaryKey="false" required="false" type="BIGINT" size="19"
autoIncrement="false"/>
<column name="maxclearance" primaryKey="false" required="false" type="BIGINT"
size="19" autoIncrement="false"/>
<column name="type" primaryKey="false" required="false" type="VARCHAR"
autoIncrement="false"/>
<unique name="aaaaaxmldata_pk">
<unique-column name="chunkid"/>
</unique>
<index name="datacatagorytreexmldata">
<index-column name="categoryid"/>
</index>
<index name="xmldatacatagory">
<index-column name="categoryid"/>
</index>
</table>