Tag: postgresql



7 May 10

To install latest version of postgresql we first we need to add pgdg repository to list of repositories open terminal and fire following commands, you need to be root.

wget http://yum.pgsqlrpms.org/reporpms/8.4/pgdg-redhat-8.4-1.noarch.rpm
rpm -Uhv pgdg-redhat-8.4-1.noarch.rpm

Once repository is installed properly use yum to install postgresql as shown below

yum install postgresql
yum install postgresql-server

You can do above in a single line choice is yours.

Initialize the database

initdb -D /usr/local/pgsql/data

Start the database server

pg_ctl start -D /usr/local/pgsql/data

Voila your database server is setup and ready to use.

 


Filed under: OpenSource,Programming

Trackback Uri






13 Dec 09

Few days back I was trying to create database in a batch job using createdb.exe and I encountered this problem createdb.exe prompts for password and there is no way of passing password from command line as an argument.
I tried to find out how to do this but in vein there is no way you can pass password as an command line argument; than after looking around for sometime and googling I found two ways of doing it

  • Setting up PGPASSWORD environment variable : This method is not preferable as it’s insecure more for further details read this


  • Setting up password in pgpass.conf : The file is to be located
    %APPDATA%\postgresql\pgpass.conf

File has the following format

hostname:port:database:username:password

Each of the first four fields may be a literal value, or *, which matches anything.

For further details the postgres documentation


Filed under: OpenSource

Trackback Uri