You are here: Re: [ot] listing foreign keys in mySQL on InnoDB « PHP Programming Language « IT news, forums, messages
Re: [ot] listing foreign keys in mySQL on InnoDB

Posted by Rik on 01/25/07 13:58

On Thu, 25 Jan 2007 14:42:01 +0100, Erwin Moller
<since_humans_read_this_I_am_spammed_too_much@spamyourself.com> wrote:

> Rik wrote:
>
>> On Thu, 25 Jan 2007 11:15:01 +0100, Erwin Moller
>> <since_humans_read_this_I_am_spammed_too_much@spamyourself.com> wrote:
>>
>>> Erwin Moller wrote:
>>> In case somebody wants to see all Foreign Keys, I found place where
>>> they
>>> are
>>> listed, be it in a userunfriendly way:
>>>
>>> Just connect to:
>>> - information_schema (it should be in any mySQL database)
>>> - check the table TABLE_CONSTRAINTS
>>>
>>> It lists all CONSTRAINTS. The column CONSTRAINT_TYPE will contain stuff
>>> like
>>> 'FOREIGN KEY' or 'PRIMARY KEY'.
>>> Quite straightforward.
>>> (My current knowledge of mysql is too meager to say if anybody in a
>>> shared
>>> environment can read this table.)
>>
>> Unfortunately, usually they can't.
>>
>
> Ah darn, there goes my good advise. ;-)
>
> Luckily, if you define FK in the way you showed they DO show up with SHOW
> CREATE TABLE tbl_XXX.
> Still mySQL should really consider improving their FK support.
> After all, that is what 'relational' means in a relational database. ;-)

Yup.
What's worse, a lot of (cheaper) hosters do have MySQL, but don't allow
InnoDB tables. Unfortunately, I've grown quite accustomed to write my own
integrity queries for projects where for some reason people liked to pay
tons of money for bad hosting, and refused to switch.... It's a terrible
paint to have check up to ten tables manually on every delete and update.

Then again, a colleague of mine hates database-enforced referential
integrity, for the simple reason he can't find it in his own code...
--
Rik Wasmus
* I'm testing several new newsreaders at the moment. Please excuse
possible errors and weird content. *

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация