Re: Range Types, constructors, and the type system

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Range Types, constructors, and the type system
Дата
Msg-id BANLkTi=cGF2s0Y=UCQtLDityppVO2jdJ4w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Range Types, constructors, and the type system  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: Range Types, constructors, and the type system
Re: Range Types, constructors, and the type system
Список pgsql-hackers
On Wed, Jun 29, 2011 at 11:41 AM, Jeff Davis <pgsql@j-davis.com> wrote:
> Robert didn't really seem to like the idea of throwing an error though
> -- Robert, can you expand on your reasoning here?

I guess I don't have any terribly well-thought out reasoning - maybe
it's fine.  It just seems strange to have a type that you can't
display.

But now that I'm thinking about this a little more, I'm worried about this case:

CREATE TABLE foo AS RANGE('something'::funkytype, 'somethingelse'::funktype);
DROP TYPE funkytype;

It seems to me that the first statement had better fail, or else the
second one is going to create a hopeless mess (imagine that a new type
comes along and gets the OID of funkytype).

It also seems a bit strange to me that we're contemplating a system
where users are always going to have to cast the return type.
Generally, casts are annoying and we want to minimize the need for
them.  I'm not sure what the alternative is, though, unless we create
separate constructor functions for each type: int8range_cc(1, 2).

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


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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: patch: Allow \dd to show constraint comments
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Inconsistency between postgresql.conf and docs