[Haskell-cafe] Using HaskellDB on Tables that contain same column names

Justin Bailey jgbailey at gmail.com
Mon Nov 2 11:10:02 EST 2009

I'd recommend sending HaskellDB questions to the haskelldb users
mailing list. You do need to subscribe first. Now to your question:

On Sat, Oct 31, 2009 at 2:38 AM, R. Emre Başar <reb at cs.bilgi.edu.tr> wrote:
> Hi all,
> project (Server.name << s!Server.name #
>         Vendor.name << v!Vendor.name #
>         Model.name << m!Model.name #
>         Server.system_id << s!Server.system_id)

This is by design. Just like in SQL, the column names are not
disambiguated. If you wrote a SQL query like:

  select * from Server join Model on ... join Vendor on ...

you would get duplicate column names. You must use unique column names
in the projection. Check out the haskelldb-th package for Template
Haskell utils for easily creating column names if you don't want to
declare them by hand.


More information about the Haskell-Cafe mailing list