Re: Range Types and extensions

Поиск
Список
Период
Сортировка
От David Fetter
Тема Re: Range Types and extensions
Дата
Msg-id 20110620134452.GD19779@fetter.org
обсуждение исходный текст
Ответ на Re: Range Types and extensions  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
On Sun, Jun 19, 2011 at 11:33:02PM -0700, Jeff Davis wrote:
> On Sun, 2011-06-19 at 21:29 +0200, Florian Pflug wrote:
> > If I'm not mistaken about this, that would imply that we also
> > cannot have two range types with the same base type, the same
> > opclass, but different collations. Which seems rather
> > unfortunate... In fact, if that's true, maybe restricing range
> > types to the database collation would be best...
> 
> Yes, we cannot have two range types with the same base type. That is
> a consequence of the polymorphic type system, which needs to be able
> to determine the range type given the base type.
> 
> A workaround is to use domains. That is effective, but awkward. For
> instance, given:
>   CREATE DOMAIN textdomain AS text;
>   CREATE TYPE textdomainrange AS RANGE (subtype=textdomain);
> then:
>   '[a,z)'::textdomainrange @> 'b'::textdomain
> would work, but:
>   '[a,z)'::textdomainrange @> 'b'
> would not, which would be annoying.
> 
> I don't see a way around this. It's not a collation problem, but a
> general "multiple range types with the same subtype" problem.

How might you address that problem, assuming you had the needed
resources to do it?

Cheers,
David.
-- 
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: ALTER TABLE lock strength reduction patch is unsafe
Следующее
От: Michael Meskes
Дата:
Сообщение: Re: Re: [COMMITTERS] pgsql: Fixed string in German translation that causes segfault.