-1

What I tried:

create table name
(id bigserial not null primary key, cash money not null default 0.0);

Why does this code refuse to work? how to correct?

4

1 回答 1

2

Reading the documentation generally helps: Monetary types

Input is accepted in a variety of formats, including integer and floating-point literals, as well as typical currency formatting, such as '$1,000.00'. Output is generally in the latter form but depends on the locale. Non-quoted numeric values can be converted to money by casting the numeric value to text and then money, for example:

SELECT 1234::text::money;
于 2012-10-20T18:29:01.910 回答