From 30b0bba06704908449587618fb40fe05d902f953 Mon Sep 17 00:00:00 2001 From: Mark Huang Date: Thu, 9 Nov 2006 19:34:04 +0000 Subject: [PATCH] - selectall: key_field implies hashref --- PLC/PostgreSQL.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PLC/PostgreSQL.py b/PLC/PostgreSQL.py index fa5f1cfb..30e9c461 100644 --- a/PLC/PostgreSQL.py +++ b/PLC/PostgreSQL.py @@ -5,7 +5,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: PostgreSQL.py,v 1.8 2006/10/30 16:37:49 mlhuang Exp $ +# $Id: PostgreSQL.py,v 1.9 2006/11/08 22:43:02 mlhuang Exp $ # import psycopg2 @@ -178,7 +178,7 @@ class PostgreSQL: self.execute(query, params) rows = self.cursor.fetchall() - if hashref: + if hashref or key_field is not None: # Return each row as a dictionary keyed on field name # (like DBI selectrow_hashref()). labels = [column[0] for column in self.description] -- 2.47.0