Re: lexing small ints as int2 - Mailing list pgsql-hackers

From Robert Haas
Subject Re: lexing small ints as int2
Date
Msg-id AANLkTikBDKzP-eD7mXG1sacwSRPtzoFeStCVAnuDj9ot@mail.gmail.com
Whole thread Raw
In response to Re: lexing small ints as int2  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sun, Sep 5, 2010 at 1:05 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.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


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)
Next
From: Dean Rasheed
Date:
Subject: Re: Functional dependencies and GROUP BY