MySQL Forums
Forum List  »  General

Re: Unique Constraint Using My Own Definition of "Equals"
Posted by: B C
Date: March 07, 2009 10:16PM

Rick - thank you very much for the reply. That is a great idea. But since only one script in my entire application needs to select on this column, there's not much benefit in making a comparator function just for that purpose. It's also not critical that I save the user input representation of the data - so an extra column would be unnecessary overhead.

The big issue was getting the DBMS to enforce the funny constraint. I typically like to make sure the database, not the application, is responsible for maintaining the integrity of my data. That way, if myself or one of the other developers write a buggy PHP script, we can't introduce inconsistencies into our database. (Its entirely possible that one of us could forget to "clean up" the input before inserting it.)

But at the moment, it looks like I'm SOL. I'll just have to be careful about inspecting myinsert queries closely.

Options: ReplyQuote


Subject
Written By
Posted
Re: Unique Constraint Using My Own Definition of "Equals"
B C
March 07, 2009 10:16PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.