Re: lexing small ints as int2

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: lexing small ints as int2
Date: 2010-09-05 13:22:48
Message-ID: AANLkTikBDKzP-eD7mXG1sacwSRPtzoFeStCVAnuDj9ot@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Sep 5, 2010 at 1:05 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> I am not too sure that the distinction between implicit casts and
>> assignment casts is all that useful;
>
> We've been there and done that; it doesn't work.  The current scheme
> was invented specifically because a two-way design didn't work.
>
> http://archives.postgresql.org/pgsql-hackers/2002-09/msg00900.php

Well, sure, if you remove the distinction between implicit and
assignment casts *without doing anything else*, it's not going to
work. But that's not what I proposed.

And as Peter said in one of his responses: "Finally, I believe this
paints over the real problems, namely the inadequate and hardcoded
type category preferences and the inadequate handling of numerical
constants. Both of these issues have had adequate approaches proposed
in the past and would solve this an a number of other issues." I
agree. We pride ourselves on having an extensible database product,
but our current type system is fairly hostile to extension. The
typispreferred stuff works OK for deciding between two types (which is
not coincidentally the number of distinct values that can be
represented by a Boolean column) but after that it breaks down pretty
quickly. If you're adding specialized types to represent zoo animals
or constellations or six-dimensional polyhedra, it works OK, but if
you try to add addition stringy or numbery things, there are problems.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2010-09-05 14:23:34 Re: Functional dependencies and GROUP BY
Previous Message Greg Stark 2010-09-05 10:44:27 Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)