Re: How to make a dictoinary list of a query result

Поиск
Список
Период
Сортировка
От Mikhail Terekhov
Тема Re: How to make a dictoinary list of a query result
Дата
Msg-id 3E44089B.2000002@emc.com
обсуждение исходный текст
Список 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 по дате отправления: