decimal(9.2)

Started by Herbert Liechtialmost 27 years ago5 messagesgeneral
Jump to latest
#1Herbert Liechti
Herbert.Liechti@thinx.ch

Hello

How do I define the datatype decimal(9.2). I searched the documentation
but the only thing I found was the money data type which is in my case
not very usefull.

Is there a way to declare a datatype with 2 decimal places and with a fixed
precision? Thanks for your help

Herbie

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Herbert Liechti E-Mail: Herbert.Liechti@thinx.ch
ThinX networked business services Stahlrain 10, CH-5200 Brugg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#2Herbert Liechti
Herbert.Liechti@thinx.ch
In reply to: Herbert Liechti (#1)
Re: [GENERAL] decimal(9.2)

Hans Peter W�rmli wrote:

Try:

dbhpw=> create table therbert (num numeric(9,2));

Is not working. I got the following error:

db=> create table therbert (num numeric(9,2));
ERROR: NUMERIC scale 2 must be zero

I use PostgreSQL 6.4.0 on i586-pc-linux-gnu, compiled by gcc egcs-2.91.6

Any other hints?

On 25-Jun-99 Herbert Liechti wrote:

Hello

How do I define the datatype decimal(9.2). I searched the documentation
but the only thing I found was the money data type which is in my case
not very usefull.

Is there a way to declare a datatype with 2 decimal places and with a fixed
precision? Thanks for your help

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Herbert Liechti E-Mail: Herbert.Liechti@thinx.ch
ThinX networked business services Stahlrain 10, CH-5200 Brugg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#3Hans Peter Würmli
wurmli@datacomm.ch
In reply to: Herbert Liechti (#1)
RE: [GENERAL] decimal(9.2)

Try:

dbhpw=> create table therbert (num numeric(9,2));

H.P.

On 25-Jun-99 Herbert Liechti wrote:

Hello

How do I define the datatype decimal(9.2). I searched the documentation
but the only thing I found was the money data type which is in my case
not very usefull.

Is there a way to declare a datatype with 2 decimal places and with a fixed
precision? Thanks for your help

Herbie

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Herbert Liechti E-Mail: Herbert.Liechti@thinx.ch
ThinX networked business services Stahlrain 10, CH-5200 Brugg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

----------------------------------
E-Mail: Hans Peter W�rmli <wurmli@datacomm.ch>
Date: 25-Jun-99
Time: 20:36:00

This message was sent by XFMail
----------------------------------

#4Michael J Davis
michael.j.davis@tvguide.com
In reply to: Hans Peter Würmli (#3)
RE: [GENERAL] decimal(9.2)

What version of PostgreSQL? Version 6.5 is needed for complete decimal and
number support.

Show quoted text

-----Original Message-----
From: Herbert Liechti [SMTP:Herbert.Liechti@thinx.ch]
Sent: Friday, June 25, 1999 10:59 AM
To: postgres
Subject: [GENERAL] decimal(9.2)

Hello

How do I define the datatype decimal(9.2). I searched the documentation
but the only thing I found was the money data type which is in my case
not very usefull.

Is there a way to declare a datatype with 2 decimal places and with a
fixed
precision? Thanks for your help

Herbie

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~
Herbert Liechti E-Mail:
Herbert.Liechti@thinx.ch
ThinX networked business services Stahlrain 10, CH-5200
Brugg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~

#5Hans Peter Würmli
wurmli@datacomm.ch
In reply to: Herbert Liechti (#2)
Re: [GENERAL] decimal(9.2)

Sorry, yes you need 6.5 for the general numeric type.

H.P.

Show quoted text

On 25-Jun-99 Herbert Liechti wrote:

Hans Peter W�rmli wrote:

Try:

dbhpw=> create table therbert (num numeric(9,2));

Is not working. I got the following error:

db=> create table therbert (num numeric(9,2));
ERROR: NUMERIC scale 2 must be zero

I use PostgreSQL 6.4.0 on i586-pc-linux-gnu, compiled by gcc egcs-2.91.6

Any other hints?