2012-02-27 36 views
5

sự khác biệt giữa kiểu dữ liệu thập phân và kiểu dữ liệu số trong postgresql là gì? Tôi không tìm thấy bất kỳ sự khác biệt trong hướng dẫn sử dụng.sự khác biệt giữa kiểu dữ liệu thập phân và số trong postgresql

+1

Bạn có thể theo các liên kết đưa ra dưới đây: http://stackoverflow.com/questions/1841915/difference-betweeen-decimal-and-numeric – jyotiprakash

+0

THANKS, nó giúp –

Trả lời

2

không có sự khác biệt trong PostgreSQL. Per documentation:

Các loại decimalnumeric tương đương. Cả hai loại là một phần của tiêu chuẩn SQL.

0

Trích dẫn từ: https://www.postgresql.org/message-id/[email protected]

Không có bất kỳ sự khác biệt, trong Postgres. Có hai loại tên vì tiêu chuẩn SQL yêu cầu chúng tôi chấp nhận cả hai tên. Trong một xem nhanh trong tiêu chuẩn có vẻ là khác biệt duy nhất là thế này:

 17)NUMERIC specifies the data type exact numeric, with the decimal 
     precision and scale specified by the <precision> and <scale>. 

    18)DECIMAL specifies the data type exact numeric, with the decimal 
     scale specified by the <scale> and the implementation-defined 
     decimal precision equal to or greater than the value of the 
     specified <precision>. 

tức là, cho DECIMAL thực hiện được phép để cho phép nhiều chữ số hơn yêu cầu bên trái dấu thập phân. Postgres không thực hiện quyền tự do đó nên không có sự khác biệt nào giữa các loại này đối với chúng tôi.

 regards, tom lane 
Các vấn đề liên quan