Chinaunix首页 | 论坛 | 博客
  • 博客访问: 627761
  • 博文数量: 149
  • 博客积分: 3901
  • 博客等级: 中校
  • 技术积分: 1558
  • 用 户 组: 普通用户
  • 注册时间: 2009-02-16 14:33
文章分类

全部博文(149)

文章存档

2014年(2)

2013年(10)

2012年(32)

2011年(21)

2010年(84)

分类: 服务器与存储

2012-04-27 19:50:49



下载
python setup.py build  #需要修改 指定 pg_config 文件路径
python setup.py install

@API pg.html

import pgdb
db = pgdb.connect(user='postgres',database = 'postgres', host = '127.0.0.1',password='')
cur = db.cursor()
cur.execute("select  myname,AsText(pt) from test1 where ST_within( pt, 'POLYGON((0 0,0 70,100 70,100 0,0 0))' ) ;")
print cur.rowcount
cur.next()
# ['shanghai', 'POINT(31.5 60.87)']

import pgdb
db = pgdb.connect(user='postgres',database = 'postgres', host = '127.0.0.1',password='')
cur = db.cursor()
cur.execute('delete from test1;')
db.commit()




阅读(1429) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~