PostgreSQL 8.1 Sensational release, I also intend to migrate some of the original SQL Server applications to PostgreSQL, the first need to migrate a table, then this must first understand the data types in the two database mapping relationship. Check out the PostgreSQL document specially made to the following table to treat you.
Note: The money (currency) data type in PostgreSQL is now obsolete and can be replaced with numeric or decimal and with the To_char function.
The datetime, smalldatetime data types in SQL Server contain date and time parts, except for differences in precision. It corresponds to the type of timestamp (including date and time) in PostgreSQL. In PostgreSQL, if you only need the date part, you can use the date type, but only the time portion to use it.
Bytea (n) in PostgreSQL is always a variable-length binary byte array, equivalent to varbinary (n) in SQL Server, if no maximum number of bytes specified Bytea is represented as an unlimited length byte array, equivalent to I in SQL Server The Mage data type.
The character type in PostgreSQL does not differ from the two text data types of the corresponding local and internationalized text types in SQL Server, and whether the data stored in the text type of PostgreSQL is internationalized or localized depends on the text encoding settings of the database.
To ensure the internationalization of data storage, it is recommended to set the text encoding of the database to UTF-8 or Unicode to ensure that the stored text can be viewed and stored by users in different regions and cultures.
For data of the GUID type, the Bytea (16) can be used in PostgreSQL to save, and the byte array function is available for comparison.
Mapping relationships for data types in PostgreSQL, SQL Server databases