Re: [GENERAL] How to set decimal(7,2)?

From: "Jose' Soares" <jose(at)sferacarta(dot)com>
To: sim(at)infomatch(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] How to set decimal(7,2)?
Date: 1998-09-11 12:33:40
Message-ID: 35F918A4.82AB3E3B@sferacarta.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

sim wrote:
>
> How come when I try to set a variable as decimal(7,2), it
> automatically complains that decimal(7,2) is not acceptable; however,
> decimal(7,0) is okay? It changes to float4 by itself?
>
> thanks.

>From man pgbuiltin:

<DELETED>
There are some data types defined by SQL/92 syntax which
are mapped directly into native Postgres types. Note that
the "exact numerics" decimal and numeric have fully imple­
mented syntax but currently (PostgreSQL v6.3) support only
a limited range of the values allowed by SQL/92.

List of SQL/92 types
POSTGRES Type SQL/92 Type Meaning
char(n) character(n) fixed-length character string
varchar(n) character varying(n) variable-length character
string
float4/8 float(p) floating-point number with
precision p
float8 double precision double-precision
floating-point number
float8 real double-precision
floating-point number
int2 smallint signed two-byte integer
int4 int signed 4-byte integer
int4 integer signed 4-byte integer
int4 decimal(p,s) exact numeric for p <= 9, s =
0
int4 numeric(p,s) exact numeric for p == 9, s =
0
timestamp timestamp with time zone date/time
timespan interval general-use time span


Jose'

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Yogesh Bhanu 1998-09-11 13:34:24
Previous Message Jose' Soares 1998-09-11 12:28:31 Re: [GENERAL] Is it possible to drop a column?