<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to Use MySQL Foreign Keys for Quicker Database Development</title>
	<atom:link href="http://www.sitepoint.com/blogs/2009/03/12/mysql-foreign-keys-quicker-database-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sitepoint.com/blogs/2009/03/12/mysql-foreign-keys-quicker-database-development/</link>
	<description>News, opinion, and fresh thinking for web developers and designers. The official podcast of sitepoint.com.</description>
	<lastBuildDate>Mon, 23 Nov 2009 10:06:45 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: brianblocker</title>
		<link>http://www.sitepoint.com/blogs/2009/03/12/mysql-foreign-keys-quicker-database-development/comment-page-1/#comment-907368</link>
		<dc:creator>brianblocker</dc:creator>
		<pubDate>Wed, 01 Apr 2009 02:12:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=6991#comment-907368</guid>
		<description>Legit article. This is one of those that will be a turning point for me. Thanks, great examples!</description>
		<content:encoded><![CDATA[<p>Legit article. This is one of those that will be a turning point for me. Thanks, great examples!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Craig Buckler</title>
		<link>http://www.sitepoint.com/blogs/2009/03/12/mysql-foreign-keys-quicker-database-development/comment-page-1/#comment-900784</link>
		<dc:creator>Craig Buckler</dc:creator>
		<pubDate>Mon, 23 Mar 2009 11:24:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=6991#comment-900784</guid>
		<description>&lt;blockquote&gt;mysql does let you change the table type quite easily&lt;/blockquote&gt;

...but only if you&#039;re not using InnoDB-specific features such as foreign keys. You must remove the constraints to change the table type.</description>
		<content:encoded><![CDATA[<blockquote><p>mysql does let you change the table type quite easily</p></blockquote>
<p>&#8230;but only if you&#8217;re not using InnoDB-specific features such as foreign keys. You must remove the constraints to change the table type.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: r937</title>
		<link>http://www.sitepoint.com/blogs/2009/03/12/mysql-foreign-keys-quicker-database-development/comment-page-1/#comment-898600</link>
		<dc:creator>r937</dc:creator>
		<pubDate>Fri, 20 Mar 2009 17:23:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=6991#comment-898600</guid>
		<description>actually, yes, mysql does let you change the table type quite easily

;o)</description>
		<content:encoded><![CDATA[<p>actually, yes, mysql does let you change the table type quite easily</p>
<p>;o)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Craig Buckler</title>
		<link>http://www.sitepoint.com/blogs/2009/03/12/mysql-foreign-keys-quicker-database-development/comment-page-1/#comment-898588</link>
		<dc:creator>Craig Buckler</dc:creator>
		<pubDate>Fri, 20 Mar 2009 16:54:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=6991#comment-898588</guid>
		<description>&lt;blockquote&gt;both tables have to be innodb in order for foreign keys to work&lt;/blockquote&gt;

Yes - I&#039;ve just tested it. In fact, MySQL won&#039;t let you add the FK constraint or change the table type, so it&#039;s not possible to test anyway!

@Robert Treat
Thanks for the information about PostgreSQL.</description>
		<content:encoded><![CDATA[<blockquote><p>both tables have to be innodb in order for foreign keys to work</p></blockquote>
<p>Yes &#8211; I&#8217;ve just tested it. In fact, MySQL won&#8217;t let you add the FK constraint or change the table type, so it&#8217;s not possible to test anyway!</p>
<p>@Robert Treat<br />
Thanks for the information about PostgreSQL.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Treat</title>
		<link>http://www.sitepoint.com/blogs/2009/03/12/mysql-foreign-keys-quicker-database-development/comment-page-1/#comment-898017</link>
		<dc:creator>Robert Treat</dc:creator>
		<pubDate>Thu, 19 Mar 2009 23:56:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=6991#comment-898017</guid>
		<description>@craigbuckler just to clarify...
&quot;Off the top of my head, confusing things about PostgreSQL include a lack of native auto-incrementing fields (you need a function)&quot;
This isn&#039;t exactly true. You can define your tables with the serial data type, which is a psuedo dataype which handles the autoincrement bits for you automagically. It&#039;s built on top of Postgres&#039; sequence support, so it has some differences under the hood from mysqls auto-increment (mostly the trade off is mysql makes it easier to do gapless sequences, and postgres&#039;s sequences scale better).  
&quot;and not being able to easily insert a new field between two others.&quot;
I think you mean &quot;add a new column to a table between two other columns&quot;, which is true. There has been some discussion for adding this functionality, but so far there hasn&#039;t been enough demand for someone to do the work. Ambitious developers should see http://wiki.postgresql.org/wiki/Alter_column_position#Adding_alter_column_syntax_into_postgres for more info. 
HTH.</description>
		<content:encoded><![CDATA[<p>@craigbuckler just to clarify&#8230;<br />
&#8220;Off the top of my head, confusing things about PostgreSQL include a lack of native auto-incrementing fields (you need a function)&#8221;<br />
This isn&#8217;t exactly true. You can define your tables with the serial data type, which is a psuedo dataype which handles the autoincrement bits for you automagically. It&#8217;s built on top of Postgres&#8217; sequence support, so it has some differences under the hood from mysqls auto-increment (mostly the trade off is mysql makes it easier to do gapless sequences, and postgres&#8217;s sequences scale better).<br />
&#8220;and not being able to easily insert a new field between two others.&#8221;<br />
I think you mean &#8220;add a new column to a table between two other columns&#8221;, which is true. There has been some discussion for adding this functionality, but so far there hasn&#8217;t been enough demand for someone to do the work. Ambitious developers should see <a href="http://wiki.postgresql.org/wiki/Alter_column_position#Adding_alter_column_syntax_into_postgres" rel="nofollow">http://wiki.postgresql.org/wiki/Alter_column_position#Adding_alter_column_syntax_into_postgres</a> for more info.<br />
HTH.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: r937</title>
		<link>http://www.sitepoint.com/blogs/2009/03/12/mysql-foreign-keys-quicker-database-development/comment-page-1/#comment-897684</link>
		<dc:creator>r937</dc:creator>
		<pubDate>Thu, 19 Mar 2009 15:41:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=6991#comment-897684</guid>
		<description>both tables have to be innodb in order for foreign keys to work


[insert smiley here]</description>
		<content:encoded><![CDATA[<p>both tables have to be innodb in order for foreign keys to work</p>
<p>[insert smiley here]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Craig Buckler</title>
		<link>http://www.sitepoint.com/blogs/2009/03/12/mysql-foreign-keys-quicker-database-development/comment-page-1/#comment-897659</link>
		<dc:creator>Craig Buckler</dc:creator>
		<pubDate>Thu, 19 Mar 2009 15:13:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=6991#comment-897659</guid>
		<description>@hellomoto
&lt;blockquote&gt;what if may borrowed table is InnoDb, and employee is MyIsam, does mysql automatically update/delete related tables?&lt;/blockquote&gt;

It&#039;s an interesting thought and I suspect nothing will occur - but I need to test that theory! You can mix and match table types within a single database though.</description>
		<content:encoded><![CDATA[<p>@hellomoto</p>
<blockquote><p>what if may borrowed table is InnoDb, and employee is MyIsam, does mysql automatically update/delete related tables?</p></blockquote>
<p>It&#8217;s an interesting thought and I suspect nothing will occur &#8211; but I need to test that theory! You can mix and match table types within a single database though.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Craig Buckler</title>
		<link>http://www.sitepoint.com/blogs/2009/03/12/mysql-foreign-keys-quicker-database-development/comment-page-1/#comment-897529</link>
		<dc:creator>Craig Buckler</dc:creator>
		<pubDate>Thu, 19 Mar 2009 12:18:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=6991#comment-897529</guid>
		<description>Off the top of my head, confusing things about PostgreSQL include a lack of native auto-incrementing fields (you need a function) and not being able to easily insert a new field between two others. It&#039;s also less popular, not as widely available, and has fewer online resources.

That said, there is nothing wrong with using Postgres. Nor is there anything wrong with using MySQL. They are just different database engines; both have good points and neither is perfect.

Would anyone be interested in further PostgreSQL articles? Let&#039;s have a vote!</description>
		<content:encoded><![CDATA[<p>Off the top of my head, confusing things about PostgreSQL include a lack of native auto-incrementing fields (you need a function) and not being able to easily insert a new field between two others. It&#8217;s also less popular, not as widely available, and has fewer online resources.</p>
<p>That said, there is nothing wrong with using Postgres. Nor is there anything wrong with using MySQL. They are just different database engines; both have good points and neither is perfect.</p>
<p>Would anyone be interested in further PostgreSQL articles? Let&#8217;s have a vote!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: fsdavis</title>
		<link>http://www.sitepoint.com/blogs/2009/03/12/mysql-foreign-keys-quicker-database-development/comment-page-1/#comment-896527</link>
		<dc:creator>fsdavis</dc:creator>
		<pubDate>Wed, 18 Mar 2009 14:07:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=6991#comment-896527</guid>
		<description>What are the disadvantages of postgres? By happenstance I started using it instead of mysql about 12 years ago. Of course, I&#039;ve used mysql a lot since that time as well and for simple things I use sqlite. I&#039;ve also (briefly) used MS SQL Server, Sybase and Oracle. Postgres is basically an open source Oracle and has always had good data integrity including foreign keys. It hasn&#039;t been pain-free, but it has been much less painful that mysql even when using the innodb engine. Lack of standards support, the fact that one must specify a db engine just to obtain foreign key constraints, and mysql&#039;s tendency to quietly change your data makes me think of it as a toy. If you don&#039;t need those things, you might as well use sqlite which is much easier to configure. :-)

Performance is almost always the indictment against postgres, but the tests I&#039;ve seen are made using mysql without innodb, so of course mysql will be faster if there is no foreign key checking! So the biggest disadvantage I&#039;ve seen is that mysql is for some reason more popular in spite of it&#039;s shortcomings, so more open source projects support mysql. But this doesn&#039;t matter when you&#039;re building a custom app.

I don&#039;t want to start a flame war, either. But I want to mention this, because it looks like there are a lot of folks commenting here that might benefit from knowing more about the available tools. Most people that get started with bashing postgres or mysql don&#039;t know one or the other. I know them both quite well, and for my purposes, I use postgres for &quot;important&quot; apps, sqlite for everything else, and mysql only when I have to.</description>
		<content:encoded><![CDATA[<p>What are the disadvantages of postgres? By happenstance I started using it instead of mysql about 12 years ago. Of course, I&#8217;ve used mysql a lot since that time as well and for simple things I use sqlite. I&#8217;ve also (briefly) used MS SQL Server, Sybase and Oracle. Postgres is basically an open source Oracle and has always had good data integrity including foreign keys. It hasn&#8217;t been pain-free, but it has been much less painful that mysql even when using the innodb engine. Lack of standards support, the fact that one must specify a db engine just to obtain foreign key constraints, and mysql&#8217;s tendency to quietly change your data makes me think of it as a toy. If you don&#8217;t need those things, you might as well use sqlite which is much easier to configure. :-)</p>
<p>Performance is almost always the indictment against postgres, but the tests I&#8217;ve seen are made using mysql without innodb, so of course mysql will be faster if there is no foreign key checking! So the biggest disadvantage I&#8217;ve seen is that mysql is for some reason more popular in spite of it&#8217;s shortcomings, so more open source projects support mysql. But this doesn&#8217;t matter when you&#8217;re building a custom app.</p>
<p>I don&#8217;t want to start a flame war, either. But I want to mention this, because it looks like there are a lot of folks commenting here that might benefit from knowing more about the available tools. Most people that get started with bashing postgres or mysql don&#8217;t know one or the other. I know them both quite well, and for my purposes, I use postgres for &#8220;important&#8221; apps, sqlite for everything else, and mysql only when I have to.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: hellomoto</title>
		<link>http://www.sitepoint.com/blogs/2009/03/12/mysql-foreign-keys-quicker-database-development/comment-page-1/#comment-892679</link>
		<dc:creator>hellomoto</dc:creator>
		<pubDate>Fri, 13 Mar 2009 15:55:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=6991#comment-892679</guid>
		<description>thank you for article.
i have question. what if may borrowed table is InnoDb, and employee is MyIsam,does mysql automaticly update/delete related tables?
thanks</description>
		<content:encoded><![CDATA[<p>thank you for article.<br />
i have question. what if may borrowed table is InnoDb, and employee is MyIsam,does mysql automaticly update/delete related tables?<br />
thanks</p>]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.440 seconds -->
<!-- Cached page served by WP-Cache -->
