Get 2.0.7 which is out now and fixes this issue among others.
On Tuesday, 4 September 2012 18:17:24 UTC-5, Juan Diego Romero González
wrote:
>
> Hi. I'm having this error since I update to 2.0.2 when executing
> executesql()
> <class 'psycopg2.ProgrammingError'> no results to fetch
>
> 7201.
> 7202.
> 7203.
> 7204.
> 7205.
> 7206.
>
> 7207.
> 7208.
> 7209.
> 7210.
>
> # will hold our finished resultset in a list
> data = adapter.cursor.fetchall()
> # convert the list for each row into a dictionary so it's
> # easier to work with. row['field_name'] rather than row[0]
> return [dict(zip(fields,row)) for row in data]
> data = adapter.cursor.fetchall()
>
> if fields:
> if not isinstance(fields, list):
> fields = [fields]
> extracted_fields = []
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
>
> # -*- coding: utf-8 -*-
>
> db.define_table('banks',
> Field <http://web2py.glados/examples/global/vars/Field>('abm_number',
> 'integer', length=3, notnull=True),
> Field
> <http://web2py.glados/examples/global/vars/Field>('institution_name',
> 'string', notnull=True),
> Field <http://web2py.glados/examples/global/vars/Field>('short_name',
> 'string', notnull=True),
> format='%(short_name)s'
> )
>
> db.executesql('CREATE INDEX idx_banks_name ON banks (abm_number,
> (upper(short_name)));')
>
> I've fixed it adding a try for the statement in line 10 but why am I
> getting this error? I don't think that's how it is supposed to work, of
> maybe it is for PostgreSQL.
>
> Thanks in advance :)
>
> J.
>
>
--