[NTLUG:Discuss] MYSql vs. postgresql
Terry Hancock
hancock at anansispaceworks.com
Fri Feb 21 17:56:15 CST 2003
On Friday 21 February 2003 09:41 am, Paul Ingendorf wrote:
> Quoting David <david at hayes-family.org>:
> > * sub-queries, such as: SELECT * FROM SALES WHERE ITEM_COLOR IS IN
> > (SELECT COLOR FROM ....). To do this in Mysql, you need to run
> > multiple queries and tie them together in your PHP or Perl script.
>
> I have always dealt with this using
> select * from sales,otherdb where sales.item_color = otherdb.color
> (Comming soon)
> http://www.mysql.com/doc/en/ANSI_diff_Sub-selects.html
Coming soon? Doesn't that work in v3.23? Maybe I'm missing a subtlety here,
but I think I have code like this in my current project somewhere. This is
really just an implicit join, isn't it?
Regarding "constraints", BTW, the MySQL way is to just use an ENUM type. Or
you can look it up in the form layer. Since I use Python on top of it, I
usually expect to do stuff like that in the interface layer. Yeah, I know
that means more to debug, but so far it's not much of a problem.
Besides, the amount of checking that *any* SQL language is going to let you
do will automatically be limited -- with Python (or any other complete
language), I can check for other kinds of consistency like "Does the user
have a home directory on this computer?" which are implicitly beyond the
scope of SQL, as well as internal checks (so the burden of doing internal
checks is not so onerous).
Cheers,
Terry
--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks http://www.anansispaceworks.com
More information about the Discuss
mailing list