PyGres????

Paul Sheer psheer at obsidian.co.za
Tue Aug 8 06:47:21 EDT 2000


goto
	http://www.obsidian.co.za/koala/
don't exactly understand your question, but koala
uses PyGres exclusively, so it should have examples
for you

-paul

In article <slrn8ouf7c.i4p.kc5tja at garnet.armored.net>,
kc5tja at garnet.armored.net (Samuel A. Falvo II) wrote:
> I've managed to get ahold of PyGres, a module that allows Python
> applications to access Postgre databases.  However, there isn't a *word*
> of documentation *anywhere* on how to use this thing, not with it, nor
> on the Internet, based on my Google and python.org searches.
> 
> I'm having two issues.  First, I can't seem to connect to a database
> without typing the name of the database *precisely*.  That is, it's not
> case insensitive.  For example, basics.DB("testDB") might work, while
> basics.DB("testdb") will likely NOT work.  A minor issue, and one which
> I can work around.  But it really is very annoying.
> 
> Second, and far more important, is how the heck do I access individual
> records piecemeal?  In other words, suppose I have:
> 
> 	>>> import basics	# from /usr/share/doc/python-pygres/tutorial db =
> 	>>> basics.DB("testDB") db.query("Select * from weather;");
> 
> the db.query() function call above will return a *string* containing the
> PostgreSQL table information.  This formatting is thoroughly
> unacceptable for my needs.  Is there any way to get that DB object
> return something more suitable for automated processing, such as a list
> of lists:
> 
> 		ColumnA | ColumnB
> 		--------+--------
> 		  45    |   90
> 		 22.5   |   50
>  
> would be returned as:
> 
> 	[[45,22.5],[90,50]]
> 
> or something of this nature?  I can sure use any advice you folks have
> to offer.  :-)
> 
> Thanks in advance!
> 


-- 
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.3i

mQCNAzdiRpAAAAEEANPUPC/Lrs4OCJOjWaIWaCYTzTIY1p73uPY+8ZOJH5fc4QNp
IAX+EFQ/yZ3RMOLg8yy++HufzBwDoePO4W0MKwyVFCcNIIjsY6JCXWdbpQXsY1LL
OASlGexQnEQ4mfc7ThOAKWSgPyiMv5vDJ6S0EL8rdIFL7fVv56BAxnN042FRAAUR
tCJQYXVsIFNoZWVyIDxwc2hlZXJAb2JzaWRpYW4uY28uemE+iQCVAwUQN2JGkKBA
xnN042FRAQF5CAP/Y0TaguqCpYiTEBHxZPpT/dliInVRBzryi4gdlgX6CCLDRRGH
ATP4ac8aiATegc4ev4+vcdn4fBwc6fQ2AP6hd25ZI93vShxztM/bQlGWy0zp79Uo
+69uGdJhdvgYpIsTCqppM/yjeXAJEqq5TG2Gy4pqHY235rspmeA/fX7kgIo=
=aX4m
-----END PGP PUBLIC KEY BLOCK-----

Cellular . . . +27 83 604 0615 . . . .  Land . . . +27 21 761 7224
Obsidian Systems . . . .  Linux installations, support, networking
info at obsidian.co.za . . . . . . . . . .  Tel  . .  +27 21 448 9265
http://www.obsidian.co.za  . . . . . . . Jhb . . . +27 11 792 6500
L I N U X . . . . . . . . . . . . . The Choice of a GNU Generation




More information about the Python-list mailing list