[Zope-DB] PsycoPG adaptor problem?

Iain Anderson Jethro.Anderson@bristol.ac.uk
Mon, 11 Nov 2002 19:27:05 -0000


Not legal SQL - all tables have an ID column - thus the message when you 
select *

You'll have to select explicit column names


--On Monday, November 11, 2002 11:49:15 -0700 VanL <vlindberg@verio.net> 
wrote:

> Hello,
>
> I have what appears to be a legal SQL query that gives me a valueerror
> when I try to run it from a ZSQL method.
>
> SELECT * FROM account A,
> customer C,
> legacy L,
> target T,
> WHERE C.id = A.cid
> AND LA.id = A.lid
> AND TA.id = A.tid
> AND A.name like <dtml-sqlvar name type="string">;
>
> Running this from psql gives no error. Running this from the ZSQL Method
> gives:
>
> *Error, /exceptions.ValueError/:* Duplicate column name, id
>
> I know that I have a column named 'id' in each table, but to say that I
> can't return * from a join across them because of that doesn't make
> sense.  Has anyone worked around this somehow?
>
> I am using Zope 2.60, (Z)PsycoPG 1.0.13.
>
> VanL
>
> ------------------------------------------------------------------------
>
>
> _______________________________________________
> Zope-DB mailing list
> Zope-DB@zope.org
> http://lists.zope.org/mailman/listinfo/zope-db
>



Iain (Jethro) Anderson - DBA (ISYS) University of Bristol
Pigsty Morris   City Clickers Step and Clog
Instep Research Team  Insword Rapper

"Never give a sword to a man who can't dance"