使用Postgres

介绍

Windows用户所关心的,最新版本的Postgres在Windows下正常工作。从这里下载

安装

在上面的链接里有在Windows下安装Postgres的详细信息所以在这里我不进行说明。在Windows下从DOS命令行提示符下使用下列命令给Postgres安装Seagull schema。

创建seagull数据库

C:\Documents and Settings\Administrator> createdb seagull

登陆到数据库

C:\Documents and Settings\Administrator> psql seagull

导入schema和data文件

'' making sure your path to the schema is correct
seagull=# \i  schema.pg.sql
seagull=# \i  data.default.pg.sql

配置

接下来所有你需要做的就是正确配置Seagull,下面是一些典型设置:

[db]
type                    = pgsql
host                    = localhost
protocol                = unix
port                    = 5432
user                    = Administrator ; whatever your Windows login name is
pass                    = 
name                    = seagull

如果你对在一个客户端同时访问Postgres和MySQL数据库感兴趣,而且喜欢SQL语句的自动完成功能,可以尝试Aqua Data Studio工具,个人可以免费使用。

问题解决

如果你在Linux上运行PostgreSQL并通过Unix domain socket而不使用TCP/IP的常用端口5432,你必须修改全局配置文件中的两个配置:

  • protocol = unix
  • host = false

其次,少量明显的配置是很重要的,没有它使用DataObjet将连接不到数据库,更多详细资料在15-Dec-2003 06:47 Cybertinus 发表的http://uk2.php.net/manual/en/function.pg-connect.php

 
howto/db/workingwithpostgres.txt · 最后更改: 2010/05/30 00:21 (外部编辑)
 
Except where otherwise noted, content on this wiki is licensed under the following license:GNU Free Documentation License 1.2