Archive for April, 2013

Linux: Top RPM command examples (install, uninstall, query)

Sunday, April 7th, 2013

Probably the best page on the subject: rpm command examples

Amazon EC2: Installing Postgresql 9

Tuesday, April 2nd, 2013

Amazon default yum

[root@ip ~]# sudo su -
[root@ip ~]# adduser postgres
[root@ip ~]# yum install postgresql9-libs.x86_64  postgresql9.x86_64 postgresql9-server.x86_64 postgresql9-contrib.x86_64
[root@ip ~]# su - postgres
[postgress@ip ~]# initdb  --pgdata=/var/lib/pgsql9/data -E 'UTF-8' --lc-collate='en_US.UTF-8' --lc-ctype='en_US.UTF-8'
[postgress@ip ~]# exit
[root@ip ~]# service postgresql start

To change the pgdata edit the /etc/init.d/postgresql

Then, test your postgres:

[root@ip ~]# su - postgres
[postgres@ip ~]# psql
postgres=# l

And you should see something like:

                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
(3 rows)

Sources: basic install instructions
and
UTF8 Default

Linux way

Yum installation postgres