PostgreSQL整天都说自己是最高级的开源数据库,那有时候我们也会做一些Oracle到PostgreSQL的迁移。于是就配一下。
文/图 王文文(鲜橙加冰)
文/图 王文文(鲜橙加冰)
系统是ubuntu9.10
首先唠叨一下,官方有打包好的EnterpiseDB,支持图形界面一键安装和--mode text文本安装,很方便。
1.先关闭Selinux,这个东东×××全了,高手就调一下规则,低手就学我把。disabled掉它(ubuntu用户略过这步)。
2.sudo apt-get install postgresql
3.sudo /etc/init.d/postgresql-8.4 restart
4.su - postgres
createuser -ADPE test
createdb -O test test
(这句的意思是CREATE DATABASE)
createlang plpgsql test
(createlang 是一个用于向 PostgreSQL 数据库增加新的编程语言的工具。 它可以处理所有 PostgreSQL 版本缺省就提供的语言,但是不能处理其它方面提供的语言)
psql -h 127.0.0.1 -U test test
附录:
PostgreSQL默认的超级管理员密码是postgres
连接方法:psql -U postgres(注意,是大写的-U)
默认密码为空
修改密码的方法是,用psql登入管理:psql -U postgres
然后用这样的命令来修改密码:alter user postgres with password 'new password'
如果需要远程连接,注意修改配置文件:
To enable TCP/IP connections, edit the file /etc/postgresql/8.3/main/postgresql.conf
Locate the line #listen_addresses = 'localhost' and change it to:
listen_addresses = 'localhost'

2.sudo apt-get install postgresql
3.sudo /etc/init.d/postgresql-8.4 restart
4.su - postgres
createuser -ADPE test
createdb -O test test
(这句的意思是CREATE DATABASE)
createlang plpgsql test
(createlang 是一个用于向 PostgreSQL 数据库增加新的编程语言的工具。 它可以处理所有 PostgreSQL 版本缺省就提供的语言,但是不能处理其它方面提供的语言)
psql -h 127.0.0.1 -U test test
附录:
PostgreSQL默认的超级管理员密码是postgres
连接方法:psql -U postgres(注意,是大写的-U)
默认密码为空
修改密码的方法是,用psql登入管理:psql -U postgres
然后用这样的命令来修改密码:alter user postgres with password 'new password'
如果需要远程连接,注意修改配置文件:
To enable TCP/IP connections, edit the file /etc/postgresql/8.3/main/postgresql.conf
Locate the line #listen_addresses = 'localhost' and change it to:
listen_addresses = 'localhost'



转载于:https://blog.51cto.com/verdureorange/252326