From alesv@fbl.cz Wed Sep 22 12:07:35 1999 Received: from mbox.fbl-net.cz (root@[195.119.174.1]) by hub.org (8.9.3/8.9.3) with ESMTP id IAA44052 for ; Wed, 22 Sep 1999 08:07:35 -0400 (EDT) (envelope-from alesv@fbl.cz) Received: from ales (really [195.119.174.119]) by ns.fbl-net.cz via smail with smtp id (Debian Smail3.2.0.101) for ; Wed, 22 Sep 1999 12:58:20 +0200 (CEST) Message-ID: <001601bf04f3$5f60b2c0$77ae77c3@ales> From: "=?iso-8859-2?B?QWxluSBWb2rh6GVr?=" To: Subject: decimal Date: Wed, 22 Sep 1999 14:09:44 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0011_01BF0504.1F145EE0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 This is a multi-part message in MIME format. ------=_NextPart_000_0011_01BF0504.1F145EE0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Hi all, I'm new in postress world,=20 I have one question exists any datatype like decimal (12,6) = (123456789012.123456) in postgress? sorry for my english Ales ------=_NextPart_000_0011_01BF0504.1F145EE0 Content-Type: text/html; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable
Hi all,
I'm new in postress world, =
I have one question exists any = datatype like=20 decimal (12,6) (123456789012.123456) in postgress?
sorry for my english
Ales
------=_NextPart_000_0011_01BF0504.1F145EE0-- From jeff@hub.org Wed Sep 22 13:05:58 1999 Received: from penguin.hub.org (root@nat200.237.mpoweredpc.net [142.177.200.237]) by hub.org (8.9.3/8.9.3) with ESMTP id JAA53341 for ; Wed, 22 Sep 1999 09:05:58 -0400 (EDT) (envelope-from jeff@hub.org) Received: from localhost (jeff@localhost) by penguin.hub.org (8.9.3/8.9.3) with ESMTP id KAA15748; Wed, 22 Sep 1999 10:23:43 -0300 X-Authentication-Warning: penguin.hub.org: jeff owned process doing -bs Date: Wed, 22 Sep 1999 10:23:43 -0300 (ADT) From: Jeff MacDonald Reply-To: Jeff MacDonald To: =?X-UNKNOWN?Q?Ale=B9_Voj=E1=E8ek?= cc: pgsql-sql@postgresql.org Subject: Re: [SQL] decimal In-Reply-To: <001601bf04f3$5f60b2c0$77ae77c3@ales> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by hub.org id JAA53397 greetings, you need the numeric type ie create table example( thisvaluse numeric(12,6) ); insert into table example values(012345678912.012345); On Wed, 22 Sep 1999, Ale¹ Vojįček wrote: > Hi all, > I'm new in postress world, > I have one question exists any datatype like decimal (12,6) (123456789012.123456) in postgress? > sorry for my english > Ales > ====================================================== Jeff MacDonald jeff@hub.org webpage: http://hub.org/~jeff jeff@pgsql.com irc: bignose on EFnet ====================================================== From tgl@sss.pgh.pa.us Wed Sep 22 15:07:38 1999 Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA73827 for ; Wed, 22 Sep 1999 11:07:38 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id LAA00180; Wed, 22 Sep 1999 11:06:26 -0400 (EDT) To: "=?iso-8859-2?B?QWxluSBWb2rh6GVr?=" cc: pgsql-sql@hub.org Subject: Re: [SQL] decimal In-reply-to: Your message of Wed, 22 Sep 1999 14:09:44 +0200 <001601bf04f3$5f60b2c0$77ae77c3@ales> Date: Wed, 22 Sep 1999 11:06:26 -0400 Message-ID: <177.938012786@sss.pgh.pa.us> From: Tom Lane "=?iso-8859-2?B?QWxluSBWb2rh6GVr?=" writes: > http-equiv=3DContent-Type> > > > >
Hi all,
>
I'm new in postress world, = >
>
I have one question exists any = > datatype like=20 > decimal (12,6) (123456789012.123456) in postgress?
>
sorry for my english
>
Ales
Please don't use HTML in email... Yes, there's a full decimal/numeric implementation in Postgres 6.5 and later. regards, tom lane From nizomi@dnet.net.id Wed May 24 03:04:23 2000 Received: from smtp.dnet.net.id (IDENT:qmailr@engine9.dnet.net.id [202.148.1.21]) by hub.org (8.9.3/8.9.3) with SMTP id XAA25583 for ; Tue, 23 May 2000 23:04:23 -0400 (EDT) (envelope-from nizomi@dnet.net.id) Received: (qmail 871 invoked from network); 24 May 2000 10:00:57 +0700 Received: from nizomi.dnet.net.id (nizomi@202.148.1.198) by engine9.dnet.net.id with SMTP; 24 May 2000 10:00:57 +0700 From: Tubagus Nizomi To: pgsql-sql@postgresql.org Subject: Decimal ?? Date: Wed, 24 May 2000 09:55:51 +0700 X-Mailer: KMail [version 1.0.28] Content-Type: text/plain MIME-Version: 1.0 Message-Id: <00052410061402.00709@nizomi.dnet.net.id> Content-Transfer-Encoding: 8bit X-Archive-Number: 200005/114 I have table : create table test (name text, price numeric(6,2)); CREATE insert into test values ('John',0.75); INSERT select * from test; name | price --------- John | 0.75 but when i insert into test values ('John',3/4); INSERT select * from test; name | price --------- John | 0.00 ---> ??? why this value 0.00 but i want to 0.75 ??? help me please. i am using mandrake 7 and postgres 6.5.3 Thanks Nizomi From jdearl@yahoo.com Wed May 24 04:43:23 2000 Received: from web111.yahoomail.com (web111.yahoomail.com [205.180.60.81]) by hub.org (8.9.3/8.9.3) with SMTP id AAA09413 for ; Wed, 24 May 2000 00:43:23 -0400 (EDT) (envelope-from jdearl@yahoo.com) Received: (qmail 7380 invoked by uid 60001); 24 May 2000 04:43:10 -0000 Message-ID: <20000524044310.7379.qmail@web111.yahoomail.com> Received: from [204.31.203.254] by web111.yahoomail.com; Tue, 23 May 2000 21:43:10 PDT Date: Tue, 23 May 2000 21:43:10 -0700 (PDT) From: Jason Earl Subject: Re: Decimal ?? To: Tubagus Nizomi , pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200005/115 In PostgreSQL 7.0 (and I would bet 6.5) if you cast either the numerator or the denominator as a numeric then it does what you would expect. For example: insert into test (name, price) values ('Jason', 3::numeric/4); OR insert into test (name, price) values ('Earl', 3/4::numeric); Will do what you want. Unfortunately: insert into test (name, price) values ('Foobar', (3/4)::numeric); does _not_ do what you would expect. This (I imagine) is because PostgreSQL sees the two values, assumes they are integers and does integer division. Without knowing exactly what you are trying to do (and what language you are trying to do it in) it is hard to guess if this is helpful, so write back if you need more help. Hopefully this is helpful. Jason --- Tubagus Nizomi wrote: > I have table : > create table test (name text, price numeric(6,2)); > CREATE > insert into test values ('John',0.75); > INSERT > > select * from test; > name | price > --------- > John | 0.75 > > but when i insert into test values ('John',3/4); > INSERT > > select * from test; > name | price > --------- > John | 0.00 ---> ??? > > why this value 0.00 but i want to 0.75 ??? help me > please. > > i am using mandrake 7 and postgres 6.5.3 > > Thanks > Nizomi __________________________________________________ Do You Yahoo!? Send instant messages & get email alerts with Yahoo! Messenger. http://im.yahoo.com/ From tgl@sss.pgh.pa.us Wed May 24 04:44:38 2000 Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id AAA09593 for ; Wed, 24 May 2000 00:44:38 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id AAA05823; Wed, 24 May 2000 00:44:30 -0400 (EDT) To: Tubagus Nizomi cc: pgsql-sql@postgresql.org Subject: Re: Decimal ?? In-reply-to: <00052410061402.00709@nizomi.dnet.net.id> References: <00052410061402.00709@nizomi.dnet.net.id> Comments: In-reply-to Tubagus Nizomi message dated "Wed, 24 May 2000 09:55:51 +0700" Date: Wed, 24 May 2000 00:44:30 -0400 Message-ID: <5820.959143470@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200005/116 Tubagus Nizomi writes: > I have table : > create table test (name text, price numeric(6,2)); > but when i insert into test values ('John',3/4); > why this value 0.00 but i want to 0.75 ??? help me please. Offhand I'd bet that "3/4" is being interpreted as an integer division expression. Try "3.0/4.0" or some such if you want a fractional result... regards, tom lane