Re: [HACKERS] Numeric with '-'

From: Don Baccus <dhogaza(at)pacifier(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: bhirt(at)mobygames(dot)com, Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Numeric with '-'
Date: 2000-02-22 00:28:53
Message-ID: 3.0.1.32.20000221162853.01091a70@mail.pacifier.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 12:57 AM 2/22/00 +0100, Peter Eisentraut wrote:

>Has the ranting resulted in any idea yet? ISTM that keeping a non-integer
>number as a string all the way to the executor shouldn't hurt too much.
>After all, according to SQL 123.45 *is* a NUMERIC literal! By making it a
>float we're making our users liable to breaking all kinds of fiscal
>regulations in some places. (Ask Jan.)

Certainly there was a time in the past, at least, where cross-compilers
frequently did something along these lines, if they were designed
to support a variety of target architectures. Not so common now in the
compiler world since typically host and target both support IEEE
standard floating point operations, but 'twas so back in the days before
the standard existed and before hardware implementations proliferated.
It wouldn't impact the performance of query parsing and analysis noticably.

You have to take care when (for instance) folding operations on
constants - I suspect that somewhere in the 50K lines of the SQL92
draft or the 83K lines of the SQL3 draft precise rules for such
things are laid down. Though probably in an incomprehensible fashion!

>Speaking of 'unknown', this is my favourite brain-damaged query of all
>times:
>
>peter=> select 'a' like 'a';
>ERROR: Unable to identify an operator '~~' for types 'unknown' and 'unknown'
> You will have to retype this query using an explicit cast

That *is* very cool! :) Postgres is an amazing beast at times!

- Don Baccus, Portland OR <dhogaza(at)pacifier(dot)com>
Nature photos, on-line guides, Pacific Northwest
Rare Bird Alert Service and other goodies at
http://donb.photo.net.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Don Baccus 2000-02-22 00:34:48 Re: [HACKERS] Beta for 4:30AST ... ?
Previous Message The Hermit Hacker 2000-02-21 23:57:56 Re: [HACKERS] Beta for 4:30AST ... ?