欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2/Agda, C++/Lisp/Haskell
PyPgSQL
来自开放百科 - 灰狐
Debian
#apt-get install python2.3-pgsql
su postgres
createdb test
python
>>> from pyPgSQL import PgSQL
>>> cx = PgSQL.connect(database="test", client_encoding="utf-8", unicode_results=1)
>>> cu = cx.cursor()
>>> cu.execute("set client_encoding to unicode")
>>> cu.execute("insert into test(v) values (%s)", (u'\x99sterreich',))
>>> cu.execute("select v from test")
>>> cu.fetchone()
[u'\x99sterreich']
>>>
分享您的观点