Announcement Announcement Module
Collapse
No announcement yet.
DBRE : Reverse Engineering error when postgres table/column contains accents Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • DBRE : Reverse Engineering error when postgres table/column contains accents

    Hi,

    I have been trying to reverse a Postgres DB into roo and found a potential bug :

    If the Table or Column contains a COMMENT field with an accent, Reverse DB fails.

    Step to reproduce :

    Code:
    // Spring Roo 1.2.0.RELEASE [rev 39eb957] log opened at 
    project --topLevelPackage com.company.app
    jpa setup --database POSTGRES --provider HIBERNATE
    Create DB in pgAdmin:

    Code:
    CREATE SCHEMA "test-error"
      AUTHORIZATION postgres;
    
    CREATE TABLE "test-error"."table-with-comment"
    (
      col1 integer -- column comment
    )
    WITH (
      OIDS=FALSE
    );
    ALTER TABLE "test-error"."table-with-comment"
      OWNER TO postgres;
    COMMENT ON TABLE "test-error"."table-with-comment"
      IS 'Some comments';
    COMMENT ON COLUMN "test-error"."table-with-comment".col1 IS 'column comment';
    Modify database.properties to match actual database.

    Reverse engineering succeed :
    Code:
    database reverse engineer --schema test-error --package ~.domain
    Modify the table to add an accent in a comment :


    Code:
    ALTER TABLE "test-error"."table-with-comment" DROP COLUMN col1;
    
    ALTER TABLE "test-error"."table-with-comment" ADD COLUMN col1 integer;
    COMMENT ON COLUMN "test-error"."table-with-comment".col1 IS 'column comment ';
    Reverse fails with error :

    Invalid content in XML file. There may hidden characters in the file, such as the byte order mark (BOM). Try re-saving the xml in a text editor

    Code:
    // [failed] database reverse engineer --schema test-error --package ~.domain
    Obvious workaround : Remove all accents or special character from postgresql comments...

    Hope that helps someone
Working...
X