<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
    <channel>
        <title>CUBRID Q&amp;A</title>
        <link>http://www.cubrid.org/?mid=questions</link>
        <description>CUBRID Q&amp;A</description>
        <language>en</language>
        <pubDate>Fri, 21 Oct 2011 02:37:10 -0800</pubDate>
        <lastBuildDate>Mon, 17 Jun 2013 00:34:43 -0800</lastBuildDate>
        <generator>XpressEngine 1.4.4.1</generator>
                        										        <item>
            <title>Can&apos;t create composite foreign key with a different cardinality</title>
            <dc:creator>ovidiuv</dc:creator>
            <link>http://www.cubrid.org/questions/435664</link>
            <guid isPermaLink="true">http://www.cubrid.org/questions/435664</guid>
                                    <description><![CDATA[<div>I can't create composite foreign key with a different cardinality&nbsp;than the referenced table's primary key, even if there is a unique&nbsp;index:</div><div><br /></div><div>CREATE TABLE "ITEMS" (</div><div>&nbsp; "ID" integer AUTO_INCREMENT PRIMARY KEY,</div><div>&nbsp; "ITEM_ID" integer FOREIGN KEY REFERENCES "ITEMS",</div><div>&nbsp; UNIQUE ("ITEM_ID", "ID"),</div><div>&nbsp; FOREIGN KEY ("ID", "ITEM_ID") REFERENCES "ITEMS"("ITEM_ID", "ID")</div><div>);</div><div><br /></div><div>gives error:</div><div><br /></div><div>The number of keys of the foreign key 'fk_items_id_item_id' is different from that of the primary key 'pk_items_id'.</div><div><br /></div>]]></description>
                        <pubDate>Tue, 25 Sep 2012 02:00:42 -0800</pubDate>
                        <category>foreign key</category>
                        <category>cardinality</category>
                        <category>unique</category>
                        <category>primary key</category>
                                    <slash:comments>1</slash:comments>
                    </item>
            </channel>
</rss>
