I created a very simple String PhoneDataType ‘phone’ and assigned to a property like
@MetaProperty(datatype="phone") @Column(name = "PHONE") protected String phone;
This yielded as expected a ‘varchar’ column in DDL, which as per PostgreSQL documentation should be of unlimited length.
However, I was quite surprised when inserting a String of length 16 failed with message “too long for character varying(15)”.
So I forced a varchar(20) in column definition like below and then it worked.
@MetaProperty(datatype="phone") @Column(name = "PHONE", columnDefinition = "varchar(20)") protected String phone;
Not sure if anyone met this issue before, is there some hidden parameter somewhere in PgSQL that I missed ?