In the process of using Castle activerecord for software development, in order to achieve database migration, you must note that, otherwise,ProgramThese problems may end suddenly but cannot be predicted. Therefore, pay attention to the following points:
1. The data length must be accurately defined. If it cannot be determined, it would be longer or shorter.
Symptom: In sqlserver, if the field length is smaller than the actual data length, the database automatically truncates it, but an exception is thrown in PostgreSQL.
2. Select the binary data type.
Symptom: if the "binaryblob" data type is defined for a field, everything is normal in sqlserver, but after data is saved in PostgreSQL, it is read to the memory, the length is twice the length of the original data. The cause is not found.
Solution: Define the field as the "stringclob" data type and convert it when using it to shield the differences between different databases.