Re: Domains and supporting functions

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Domains and supporting functions
Дата
Msg-id 20060219185742.GG1323@svana.org
обсуждение исходный текст
Ответ на Re: Domains and supporting functions  (elein <elein@varlena.com>)
Ответы Re: Domains and supporting functions  (elein <elein@varlena.com>)
Re: Domains and supporting functions  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
On Sun, Feb 19, 2006 at 10:34:02AM -0800, elein wrote:
> Actually I can do and have done this.  It is being tested now.
> I did create an opclass.  It creates a UNIQUE index just fine
> for the type using the lower() functionality.  *If* it passes
> all of my testing I'll publish it tomorrow on general bits.
> Perhaps folks can help try to break it when I publish (or
> if you are around today Sunday, you can test in advance--email me
> directly.)

How is this different from the citext module I suggested?

> Now my only complaint is that ORDER BY requires the USING op
> when it should recognize the information in the opclass for
> btree > and < for the type of the sort column.  I can explain
> why it doesn't recognize the opclass information, but I think
> it should.

ORDER BY x ASC is a synonym for ORDER BY x USING >. That's the way it
is currently. To use ORDER BY by itself you need to call your operators
< and >.

> Type inheritance for base types should work by inheriting all of the
> parent's definitions and overriding them only as necessary.  What I'm
> trying to do is to demonstrate that we can weasle this functionality
> using domains.

Well, you can kind of do this by creating an implicit cast from your
type to text. Then you can use your type anywhere where text can appear
(like strpos, length, etc).

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

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

Предыдущее
От: elein
Дата:
Сообщение: Re: Domains and supporting functions
Следующее
От: Douglas McNaught
Дата:
Сообщение: Re: pg_service.conf