On Jun 2, 2008, at 1:01 PM, Jeff Putsch wrote:

>
> Which is good. I'd like the select to be modified to have a "DISTINCT
> ON (pw_entries.eid, pw_entries.uname, pw_entries.uid)" before the rest
> of the columns, something like this:
>
> SELECT DISTINCT ON (pw_entries.eid, pw_entries.uname, pw_entries.uid)
> pw_entries.domain_id AS pw_entries_domain_id,
>
> I've tried adding a distinct() call with an array argument, that
> didn't work.
>
> I've also tried putting a select(distinct=[..]) call in the chain with
> no luck.
>

we support a "distinct()" operator which should acheive this, but  
looking at the PG source code it is not correctly implemented.  There  
seems to be an extension to the "distinct" keyword argument with PG  
which works like this:

select(...., distinct=[<list of expressions>])

That should work in 0.4, though this seems to be very old code without  
unit tests.  In 0.5, I'm really not sure I like that so look for a  
possible change of that to:  select([distinct(<list of exprs>)])    
(ticket:1069)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to