Evaluate postgres boolean field

John Gordon gordon at panix.com
Fri Jan 4 20:06:52 CET 2013

In <d559ab56-241b-49d0-84fd-ebd0b70426ab at googlegroups.com> andydtaylor at gmail.com writes:

> 	for row in cursor:
> 		row_count += 1
> 		if row[4] = True
> 			print row[1]

Since row[4] is a boolean value, you should be able to just say:

   if row[4]:
       print row[1]

John Gordon                   A is for Amy, who fell down the stairs
gordon at panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

More information about the Python-list mailing list