1、
[root@ec-server root]# /etc/rc.d/init.d/postgresql start
Starting postgresql service:                               [  确定  ]
[root@ec-server root]#
2、
[root@ec-server root]# su postgres
bash-2.05b$ psql -U cowboy -d test
欢迎来到 psql, PostgreSQL 的交互终端.键入:  \copyright 获取发布信息
       \h 获取 SQL 命令的帮助
       \? 获取内部反斜扛命令的帮助
       \g 或者以分号结尾执行查询
       \q 退出test=>

解决方案 »

  1.   

    很不好意思,我才回答你的帖子。我用的是csdn助手,我看到的你给我的没有格式的短消息。我还以为是助手出问题了呢。“bash-2.05b$ psql -U cowboy -d test”我的这个命令是和我系统相对应的。我的系统中有一个cowboy的用户,一个test的数据库。
    你这样做吧:
    [root@ec-server root]# su postgres
    bash-2.05b$ createuser notwin
    Shall the new user be allowed to create databases? (y/n) y
    Shall the new user be allowed to create more new users? (y/n) n
    CREATE USER
    bash-2.05b$ createdb notwin
    CREATE DATABASE
    bash-2.05b$ psql -U notwin -d notwin
    欢迎来到 psql, PostgreSQL 的交互终端.键入:  \copyright 获取发布信息
           \h 获取 SQL 命令的帮助
           \? 获取内部反斜扛命令的帮助
           \g 或者以分号结尾执行查询
           \q 退出notwin=>
      

  2.   

    嘿,哥们,你是用把pgsql用于哪个方面呢?自己学习么?
    --------------------------------------
    Chen Zizhao
    NEHC at TOM dot COM
      

  3.   

    我createuser时出了问题,在两个问题之后,有提示说:
    psql:无法联接到服务器:No such file or directory
          服务器是否在本地运行并且在Unix域套接字
          “/tmp/.s.PGSQL.5432"上准备接受联接?
    谢谢了