<div dir="ltr"><div>I see, that's what I thought. Thanks!<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 3, 2017 at 9:16 PM, Adam Chlipala <span dir="ltr"><<a href="mailto:adamc@csail.mit.edu" target="_blank">adamc@csail.mit.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">One way is to change:<br>
files.Key<br>
into:<br>
{sql_nullable (SQL files.Key)}<br>
<br>
That's a kind of cast into a nullable type, to match the type of the other operand.<br>
<br>
I don't see a way around changing types to indicate that any column of an outer-joined table could be null.<span class=""><br>
<br>
On 07/03/2017 02:58 PM, Athene Noctua wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm having trouble with a query using multiple joins, one of which is an outer join:<br>
<br>
SELECT * FROM posts<br>
LEFT OUTER JOIN post_files ON post_files.Post = posts.Key<br>
JOIN files ON post_files.File = files.Key<br>
<br>
I think the type system assumes that posts_files.File will exist even though a post might not have any associated files, and end ups with this:<br>
<br>
Can't resolve type class instance<br>
Class constraint:<br>
{Post_files :<br>
{File : nullify string string,<br>
Post : nullify int (option int)}}<br>
Reduced to unresolvable:<br>
{File : nullify string string,<br>
Post : nullify int (option int)}<br>
<br>
Is this query resolvable in some way?<br>
</blockquote>
<br>
<br></span>
______________________________<wbr>_________________<br>
Ur mailing list<br>
<a href="mailto:Ur@impredicative.com" target="_blank">Ur@impredicative.com</a><br>
<a href="http://www.impredicative.com/cgi-bin/mailman/listinfo/ur" rel="noreferrer" target="_blank">http://www.impredicative.com/c<wbr>gi-bin/mailman/listinfo/ur</a><br>
</blockquote></div><br></div>