<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Wed Jun 19 02:00:13 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/si/jira.issueviews:issue-xml/DBAL-412/DBAL-412.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DBAL-412] PostgreSqlSchemaManager::listTableColumns() fails if there are columns defined by domains in multiple schemas</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-412</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;We use Postgresql Domains to ensure consistent column definitions across multiple tables. We also have multiple schemas in a database. Therefore we can have two domains defined in the same database with the same name, but in different schemas.&lt;/p&gt;

&lt;p&gt;In this situation, PostgreSqlSchemaManager::listTableColumns() fails when called for a table with a column defined by one of those domains. This means that PostgreSqlSchemaManager::createSchema() also fails for a schema containing such a table.&lt;/p&gt;

&lt;p&gt;```&lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;21000&amp;#93;&lt;/span&gt;: Cardinality violation: 7 ERROR:  more than one row returned by a subquery used as an expression&lt;br/&gt;
```&lt;/p&gt;

&lt;p&gt;This happens because of an error in the query definition in PostgreSqlPlatform::getListTableColumnsSQL(). The &lt;tt&gt;domain_complete_type&lt;/tt&gt; column in the query is defined by matching the name only, without reference to the schema:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;
(&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; format_type(t2.typbasetype, t2.typtypmod) &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt;   
  pg_catalog.pg_type t2                                                        
                       &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; t2.typtype = &apos;d&apos; AND t2.typname = format_type(a.atttypid, a.atttypmod)) AS domain_complete_type,                             
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The error can be corrected by making sure that the correct domain is matched by using the OID instead of the name to match:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-sql&quot;&gt;
(&lt;span class=&quot;code-keyword&quot;&gt;SELECT&lt;/span&gt; format_type(t2.typbasetype, t2.typtypmod) &lt;span class=&quot;code-keyword&quot;&gt;FROM&lt;/span&gt;   
  pg_catalog.pg_type t2                                                        
                       &lt;span class=&quot;code-keyword&quot;&gt;WHERE&lt;/span&gt; t2.typtype = &apos;d&apos; AND t2.oid = a.atttypid) AS domain_complete_type
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I can create a GitHub PR if it helps.&lt;/p&gt;</description>
                <environment>Postgresql 9.1</environment>
            <key id="14360">DBAL-412</key>
            <summary>PostgreSqlSchemaManager::listTableColumns() fails if there are columns defined by domains in multiple schemas</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="rhunwicks">Roger Hunwicks</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 Jan 2013 11:50:35 +0000</created>
                <updated>Wed, 1 May 2013 12:53:32 +0000</updated>
                    <resolved>Wed, 1 May 2013 12:53:32 +0000</resolved>
                            <version>2.3.1</version>
                                <fixVersion>2.3.4</fixVersion>
                                <component>Platforms</component>
                <component>Schema Managers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="20154" author="beberlei" created="Wed, 1 May 2013 12:53:32 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>