Re: How to make a dictoinary list of a query result - Mailing list pgsql-general

From Mikhail Terekhov
Subject Re: How to make a dictoinary list of a query result
Date
Msg-id 3E44089B.2000002@emc.com
Whole thread Raw
List pgsql-general
Use "Classic" interface:

import pg

con = pg.connect(...)
d = con.query('select id,name from account').dictresult()
print d



sanjay wrote:
> Hi All,
>
>   How to make a dictoinary list of a query result.
> Example.
> select id,name from account.
> it should be like [{'name':aaa,'id':12},{'name':bbb,'id':23},...]
>
> Thanks,
> Sanjay


pgsql-general by date:

Previous
From: greg@turnstep.com
Date:
Subject: Re: selects with large offset really slow
Next
From: "Berend Tober"
Date:
Subject: Re: converting Oracle to postgres