Re: [HACKERS] Domains and supporting functions

2006-02-20 Thread elein
On Mon, Feb 20, 2006 at 09:03:29AM +0100, Michael Paesold wrote: > Elein wrote: > >http://www.varlena.com/GeneralBits/128.php > > > >Known Problems and Issues: > > > > * Creating the table with an email PRIMARY KEY did not use our > >comparison function. It was necessary to create a unique index

Re: [HACKERS] Domains and supporting functions

2006-02-20 Thread Michael Paesold
Elein wrote: http://www.varlena.com/GeneralBits/128.php Known Problems and Issues: * Creating the table with an email PRIMARY KEY did not use our comparison function. It was necessary to create a unique index which explicitly used the email operator class. * ORDER BY requires USING op

Re: [HACKERS] Domains and supporting functions

2006-02-19 Thread elein
On Sun, Feb 19, 2006 at 10:34:02AM -0800, elein wrote: > On Sun, Feb 19, 2006 at 01:26:31AM -0500, Tom Lane wrote: > > elein <[EMAIL PROTECTED]> writes: > > > I've got a domain based on a text type. > > > I've overridden the equal operator with > > > lower(text) = lower(text). > > > > This won't w

Re: [HACKERS] Domains and supporting functions

2006-02-19 Thread elein
On Sun, Feb 19, 2006 at 11:34:21PM +0100, Martijn van Oosterhout wrote: > On Sun, Feb 19, 2006 at 01:36:41PM -0800, elein wrote: > > On Sun, Feb 19, 2006 at 10:29:35PM +0100, Martijn van Oosterhout wrote: > > > On Sun, Feb 19, 2006 at 12:59:35PM -0800, elein wrote: > > > > On Sun, Feb 19, 2006 at 0

Re: [HACKERS] Domains and supporting functions

2006-02-19 Thread Martijn van Oosterhout
On Sun, Feb 19, 2006 at 01:36:41PM -0800, elein wrote: > On Sun, Feb 19, 2006 at 10:29:35PM +0100, Martijn van Oosterhout wrote: > > On Sun, Feb 19, 2006 at 12:59:35PM -0800, elein wrote: > > > On Sun, Feb 19, 2006 at 07:57:42PM +0100, Martijn van Oosterhout wrote: > > > > ORDER BY x ASC is a synon

Re: [HACKERS] Domains and supporting functions

2006-02-19 Thread Martijn van Oosterhout
On Sun, Feb 19, 2006 at 04:35:56PM -0500, Andrew Dunstan wrote: > Have you looked at the code of citext? Unless I'm misreading, it creates > a lowercase copy of each string for each comparison. And it doesn't look > to me like it's encoding/locale aware. Its cilower function isn't terribly great

Re: [HACKERS] Domains and supporting functions

2006-02-19 Thread elein
On Sun, Feb 19, 2006 at 10:29:35PM +0100, Martijn van Oosterhout wrote: > On Sun, Feb 19, 2006 at 12:59:35PM -0800, elein wrote: > > On Sun, Feb 19, 2006 at 07:57:42PM +0100, Martijn van Oosterhout wrote: > > > ORDER BY x ASC is a synonym for ORDER BY x USING >. That's the way it > > > is currently

Re: [HACKERS] Domains and supporting functions

2006-02-19 Thread Andrew Dunstan
Martijn van Oosterhout wrote: 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

Re: [HACKERS] Domains and supporting functions

2006-02-19 Thread Martijn van Oosterhout
On Sun, Feb 19, 2006 at 12:59:35PM -0800, elein wrote: > On Sun, Feb 19, 2006 at 07:57:42PM +0100, Martijn van Oosterhout wrote: > > 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 >. > > >

Re: [HACKERS] Domains and supporting functions

2006-02-19 Thread elein
On Sun, Feb 19, 2006 at 07:57:42PM +0100, Martijn van Oosterhout wrote: > 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() fu

Re: [HACKERS] Domains and supporting functions

2006-02-19 Thread Martijn van Oosterhout
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 ge

Re: [HACKERS] Domains and supporting functions

2006-02-19 Thread elein
On Sun, Feb 19, 2006 at 01:26:31AM -0500, Tom Lane wrote: > elein <[EMAIL PROTECTED]> writes: > > I've got a domain based on a text type. > > I've overridden the equal operator with > > lower(text) = lower(text). > > This won't work, you need to make a type instead. > Actually I can do and have

Re: [HACKERS] Domains and supporting functions

2006-02-19 Thread Martijn van Oosterhout
On Sat, Feb 18, 2006 at 09:27:47PM -0800, elein wrote: > I've got a domain based on a text type. > I've overridden the equal operator with > lower(text) = lower(text). > > I created a table containing my new domain type > and can see that the equals operator is not > being used to determine unique

Re: [HACKERS] Domains and supporting functions

2006-02-18 Thread Tom Lane
elein <[EMAIL PROTECTED]> writes: > I've got a domain based on a text type. > I've overridden the equal operator with > lower(text) = lower(text). This won't work, you need to make a type instead. > If this is the way domains really are, I would strongly suggest > expanding create domain to merge

[HACKERS] Domains and supporting functions

2006-02-18 Thread elein
I've got a domain based on a text type. I've overridden the equal operator with lower(text) = lower(text). I created a table containing my new domain type and can see that the equals operator is not being used to determine uniqueness. What do I need to do to force the UNIQUE constraint to use the