[web2py] Re: 'efficiently search by tag' with postgres

2012-10-01 Thread Derek
FYI, distinct is the same as "group by all". On Saturday, September 22, 2012 3:18:32 PM UTC-7, Massimo Di Pierro wrote: > > Looks like postgres is picky and wants in groupby all the selected fields > in distinct. This should work: > > rows = db(data.id==tag.record_id)\ > (tag.name.belongs(tag

[web2py] Re: 'efficiently search by tag' with postgres

2012-09-22 Thread Massimo Di Pierro
Looks like postgres is picky and wants in groupby all the selected fields in distinct. This should work: rows = db(data.id==tag.record_id)\ (tag.name.belongs(tags)).select( data.ALL, orderby=data.id, groupby=data.id|data.value, distinct=True) On Saturday, 22 Septe

[web2py] Re: 'efficiently search by tag' with postgres

2012-09-22 Thread andrej burja
the code with problem: rows = db(data.id==tag.record_id)\ (tag.name.belongs(tags)).select( data.ALL, orderby=data.id, groupby=data.id, distinct=True) On Saturday, September 22, 2012 10:26:27 AM UTC+2, andrej burja wrote: > > hi > > i would like to use idea in bo