Re: [HACKERS] email data type first release

2004-05-17 Thread Greg Stark

Gaetano Mendola [EMAIL PROTECTED] writes:

 Comments are welcomed.

Well as long as you're asking...

Email domains are case insensitive, but the left hand side is case sensitive.
That's the only part that's hard to handle using a text data type, it would be
kind of neat if the email operators got it right.

Another thing is that it might make more sense to sort email addresses by
domain first (case insensitively of course), then by left hand side (case
sensitively). Since the domain is really the most significant bit. This is
also convenient for many systems like email since they perform better when
they can handle data in that order.

Note that this would make the type sort differently from its text
representation. This shouldn't really be a problem but occasionally you see
poorly written queries that introduce extra type conversions that the user
doesn't expect. But then if it behaves just like the text datatype then there
wouldn't be much point in using it.


-- 
greg


---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] email data type first release

2004-05-17 Thread Tommi Maekitalo
...

 Another thing is that it might make more sense to sort email addresses by
 domain first (case insensitively of course), then by left hand side (case
 sensitively). Since the domain is really the most significant bit. This
 is also convenient for many systems like email since they perform better
 when they can handle data in that order.

 Note that this would make the type sort differently from its text
 representation. This shouldn't really be a problem but occasionally you see
 poorly written queries that introduce extra type conversions that the user
 doesn't expect. But then if it behaves just like the text datatype then
 there wouldn't be much point in using it.

Sorting should then be done by top-level-domain first. Then 2nd, 3rd... and 
last by user.

[EMAIL PROTECTED]  [EMAIL PROTECTED]
and
[EMAIL PROTECTED]  [EMAIL PROTECTED]

we get then the order:
[EMAIL PROTECTED]  [EMAIL PROTECTED]  [EMAIL PROTECTED]  [EMAIL PROTECTED]

rather than (in normal text-order):
[EMAIL PROTECTED]  [EMAIL PROTECTED]  [EMAIL PROTECTED]  [EMAIL PROTECTED]

Tommi

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [HACKERS] email data type first release

2004-05-17 Thread Gaetano Mendola
Greg Stark wrote:
Gaetano Mendola [EMAIL PROTECTED] writes:

Comments are welcomed.

Well as long as you're asking...
Email domains are case insensitive, but the left hand side is case sensitive.
That's the only part that's hard to handle using a text data type, it would be
kind of neat if the email operators got it right.
Another thing is that it might make more sense to sort email addresses by
domain first (case insensitively of course), then by left hand side (case
sensitively). Since the domain is really the most significant bit. This is
also convenient for many systems like email since they perform better when
they can handle data in that order.
Note that this would make the type sort differently from its text
representation. This shouldn't really be a problem but occasionally you see
poorly written queries that introduce extra type conversions that the user
doesn't expect. But then if it behaves just like the text datatype then there
wouldn't be much point in using it.
That's true, I will order as Tommi Maekitalo suggest.

Regards
Gaetano Mendola

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
  http://www.postgresql.org/docs/faqs/FAQ.html


Re: [HACKERS] email data type first release

2004-05-17 Thread Bruno Wolff III
On Mon, May 17, 2004 at 17:11:42 +0200,
  Gaetano Mendola [EMAIL PROTECTED] wrote:
 
 That's true, I will order as Tommi Maekitalo suggest.

And how do domain literals fit into this?

[EMAIL PROTECTED] is a valid email address for me. (At least as
long as my server is at that IP address.)

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [HACKERS] email data type first release

2004-05-17 Thread Greg Stark

Tommi Maekitalo [EMAIL PROTECTED] writes:

 Sorting should then be done by top-level-domain first. Then 2nd, 3rd... and 
 last by user.

I thought of that but decided not to suggest it:

a) as far as email goes there's no relationship between [EMAIL PROTECTED] and
   [EMAIL PROTECTED] The .com doesn't mean the emails are any more related than
   [EMAIL PROTECTED] and [EMAIL PROTECTED] are. In fact in practice the latter two are
   more likely to be related.

b) it's a lot of extra work, whereas sorting by domain first is just as easy
   as sorting by lhs first.


-- 
greg


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]