全部博文(214)
分类:
2008-06-11 23:34:23
不允许管理员权限的用户运行 PostgreSQL 服务器的字样,postgresql提供一个pg_ctl.exe程序来完成安装windows的服务:
服务器必须以一个非特权的用户身份启动以避免
可能的系统安全性问题. 参阅文档获取更多
有关如何正确启动服务器的信息.
F:/usr/local/pgsql/bin/pg_ctl.exe runservice -N "PGSQL" -D "F:/usr/local/pgsql/data"然后启动PGSQL服务:
net start PGSQL
D:\>psql
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
listen_addresses = 'localhost' # what IP address(es) to listen on;然后使用客户端程序psql进行连接:
# comma-separated list of addresses;
# defaults to 'localhost', '*' = all
# (change requires restart)
port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
D:\>psql -h localhost -U root -d cnangel使用各种元命令和SQL语句无任何问题,一个Windows系统上架设的POSTGRESQL就完成了,我的POSTGRESPQL版本是postgresql v8.25 no install版本。
Welcome to psql 8.0.7, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
cnangel=# \l
List of databases
Name | Owner | Encoding
-----------+---------+-----------
QQ | cnangel | SQL_ASCII
cnangel | cnangel | SQL_ASCII
postgres | root | SQL_ASCII
root | root | SQL_ASCII
template0 | root | SQL_ASCII
template1 | root | SQL_ASCII
(6 rows)
cnangel=# alter database "QQ" owner to "QQ";
cnangel=# \l
List of databases
Name | Owner | Encoding
-----------+---------+-----------
QQ | QQ | SQL_ASCII
cnangel | cnangel | SQL_ASCII
postgres | root | SQL_ASCII
root | root | SQL_ASCII
template0 | root | SQL_ASCII
template1 | root | SQL_ASCII
(6 rows)