Re: lexing small ints as int2

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: lexing small ints as int2
Дата
Msg-id 1283562627-sup-4431@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: lexing small ints as int2  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: lexing small ints as int2  (Robert Haas <robertmhaas@gmail.com>)
Re: lexing small ints as int2  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Excerpts from Tom Lane's message of vie sep 03 19:36:06 -0400 2010:

> > Does anyone know where to find the discussion refered to here?
> > http://archives.postgresql.org/pgsql-hackers/2008-10/msg01485.php
> 
> I think this was the last time I tried it:
> http://archives.postgresql.org/pgsql-hackers/2002-11/msg00468.php

Interesting, thanks.  I also had some vague thought about conversion
distance today, thinking it could help solve the problem.

> At the time, the main motivation for worrying about it was that cases
> like "WHERE smallintcol = 42" couldn't be indexed, because 42 is int4
> not int2.  We've since fixed that by allowing cross-type operators
> to be indexable.

Yeah, that's no longer an issue fortunately.

> I also notice that one of the failure cases I cited might no longer be
> an issue now that we don't have implicit casts to text, but that change
> isn't going to do anything for the other cases.

Right.

> On the whole I'm still afraid that changing the initial typing of
> integer constants is going to break a lot of code while buying not much.
> Do you have a specific reason for reopening the issue?  Or is your
> concern something different?

The problem I'm facing is functions declared to take type smallint not
working unless the integer literal has an explicit cast.  Currently the
best answer is simply to avoid using smallint in functions, but this
isn't completely satisfying.

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)
Следующее
От: Robert Haas
Дата:
Сообщение: Re: lexing small ints as int2