<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi,<div><br></div><div>I am new to mondrian. &nbsp;I am trying to make mondrian-4.1.1.0 branch work with postgres. &nbsp;When I build, I get a test failure in&nbsp;testLevelTableAttributeAsView. &nbsp;The error comes from the cube definition in the unit test generating the following sql statement:</div><div><br></div><div><div><i>&nbsp; select "gender2"."gender" as "c0", sum("sales_fact_1997"."unit_sales") as "m0"</i></div><div><i>&nbsp; from "sales_fact_1997" as "sales_fact_1997", (</i></div><div><i>&nbsp; &nbsp; &nbsp; &nbsp; SELECT * FROM "customer"</i></div><div><i>&nbsp; &nbsp; &nbsp; ) as "gender2" where "sales_fact_1997"."customer_id" = <b>"gender2"."gender"</b> group by "c0"</i></div></div><div><br></div><div>While MySQL will ignore the type mismatch, Postgres does not like t<span style="font-size: 12pt;">he "where" clause; it should really be "gender2"."customer_id" instead of "gender2"."gender". &nbsp;In order to try to correct this, I changed the attribute in the cube&nbsp;</span><span style="font-size: 12pt;">from</span></div><div><br></div><div>&nbsp; &nbsp;<i> &lt;Attribute name='Gender' keyColumn='gender'&gt;</i></div><div><br></div><div>to&nbsp;</div><div><br></div><div>&nbsp; &nbsp; <i>&lt;Attribute name='Gender' nameColumn='gender' keyColumn='customer_id'&gt;</i></div><div><br></div><div>But this is not generating the expected result because it generates the following sql:</div><div><span style="font-size: 12pt;"><br></span></div><div><span style="font-size: 12pt;"><i>&nbsp; select "gender2".<b>"customer_id"</b> as "c0", sum("sales_fact_1997"."unit_sales") as "m0"</i></span></div><div><div><i>&nbsp; from "sales_fact_1997" as "sales_fact_1997", (</i></div><div><i>&nbsp; &nbsp; &nbsp; &nbsp; SELECT * FROM "customer"</i></div><div><i>&nbsp; &nbsp; &nbsp; ) as "gender2" where "sales_fact_1997"."customer_id" = "gender2"."customer_id" group by "c0"</i></div></div><div><br></div><div>Is this a cube definition problem or problem in the sql generation in mondrian?</div><div><br></div><div>Any help would be appreciated.</div><div><br></div><div>Thanks,</div><div><br></div><div>Suki</div><div><br></div><div><br></div>                                               </div></body>
</html>