2012年11月3日 星期六

PostgreSQL 我的第一次


Installation: http://www.postgresql.org/download/macosx/

選 one click installer,這樣才有好的 management tool 可以用。內建好像是 pgAdmin3。我們除了是 users,也是 administrators ((一人公司的缺點))



Python 3 interface: http://pypi.python.org/pypi/py-postgresql/1.1.0
>>> import postgresql
>>> db = postgresql.open('pq://postgres:***@localhost:5432/postgres')
>>> db.close()
>>> print(db)
<postgresql.driver.pq3.Connection[pq://postgres:***@localhost:5432/postgres] closed>
>>> 


接著就是為 stocktotal 開帳號跟資料庫了。還好我用過 Microsoft SQL Server,幾乎是一樣的方式。

沒有留言:

張貼留言