Re: [HACKERS] Upgrades for 6.4.1

From: jwieck(at)debis(dot)com (Jan Wieck)
To: jwieck(at)debis(dot)com
Cc: hannu(at)trust(dot)ee, maillist(at)candle(dot)pha(dot)pa(dot)us, lockhart(at)alumni(dot)caltech(dot)edu, hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Upgrades for 6.4.1
Date: 1998-12-19 01:01:16
Message-ID: m0zrAlg-000EBPC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:

> NUMERIC and DECIMAL are identical, but should be different
> from INTEGER (what they are in Postgres for now).
>
> All databases share the definition
>
> NUMERIC [(precision [, scale] )]
>
> [...]
>
> I'll hack around a little on it to see what's possible for
> us.

Easy - and the type coersion stuff helps alot!

Up to now (1.5 hours hacking) I have a NUMERIC type that
handles '+' completely, including overflow checks and
rounding.

Subtract will be trivial, because the core funcitons already
exist for the add. Multiply and divide will take some time
and then there are all the comparision operators, an operator
class and all the type conversion (int<->numeric,
float<->numeric ...).

Another tricky part I expect when telling the parser that a
literal NUMERIC must not be enclosed into single quotes.

The only ugly thing is, that I needed to put the precision
AND the scale together into atttypmod (I limited both to 99
for now and put them as prec<<8 | scale into). So pg_dump
will need attention later.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#======================================== jwieck(at)debis(dot)com (Jan Wieck) #

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-12-19 01:39:10 Re: [HACKERS] Upgrades for 6.4.1
Previous Message Clark Evans 1998-12-19 00:41:41 Help with Documentation?