2012-02-27 13 views

risposta

2

C'è no differenza in PostgreSQL. Per documentation:

I tipi decimal e numeric sono equivalenti. Entrambi i tipi fanno parte dello standard SQL.

0

Citato da: https://www.postgresql.org/message-id/[email protected]

Non c'è alcuna differenza, in Postgres. Esistono due nomi di tipo perché lo standard SQL richiede l'accettazione di entrambi i nomi. In un rapida occhiata nello standard sembra che l'unica differenza è questa:

 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>. 

cioè per decimale è consentito l'implementazione per consentire più cifre quelli richiesti alla sinistra del punto decimale. Postgres non ha il diritto di esercitare questa libertà, quindi non c'è differenza tra questi tipi per noi.

 regards, tom lane 
Problemi correlati