Mapping relationships for data types in PostgreSQL, SQL Server databases

Source: Internet
Author: User
Tags postgresql

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.