| Site Map | WizTools.org | jCraze Blog |
![]() |
PostgreSQL ConfigurationThis article deals with configuring PostgreSQL in a RedHat system. The test system was running RedHat7.2. PostgreSQL (pronounced `postgres-QL') is a open source free relational database. When compared to MySQL, this offers more features: sub-queries, procedural language support, commit/rollback, etc. The one feature where MySQL beats PostgreSQL is speed. Running PostmasterIt is assumed that PostgreSQL is installed in your system. If not install it. Installation instruction is available with the download. Download PostgreSQL from http://www.postgres.org/. Postmaster is the PostgreSQL daemon process. This process should be running for use of Postgres database. Issue the following command to check if it is running: # /usr/sbin/ntsysv See if there is a ``*'' near ``postgresql''. Else press spacebar to select it. Restart the system. Steps in Creating Postgres User and DatabaseFor creating a Postgres user, you need to have a corresponding system user. You also should note that a Postgres user can be created only by logging in the system as user ``postgres''. Not even ``root'' has this permission!
psql``psql'' is an interactive client for connecting to the Postgres database. Taking the example from the previous step, login as ``wiz'' and issue the following: $ psql -d wizdb This will give you a prompt ``wizdb=>''. This means you are now connected to the Postgres database ``wizdb''. In this prompt you can issue all types of SQL queries supported by Postgres. Another important parameter to the command ``psql'' is ``-f''. If you want to execute SQL queries from a file, say ``create.sql'', you have to give the following: $ psql -d wizdb -f create.sql All the SQL statements in the text file ``create.sql'' will be executed. To know more about the ``psql'' commands use ``\?'' in the psql prompt. Press ``^d'' or type ``\q'' to quit psql. -S.Subhash |
[Quick Stats: Number of main threads: 1, Number of sub-threads: 0]
Sign Guestbook
|
Who is Subhash?
The contents of this site are copyright© 2000-2008, indiWiz.com. All Rights Reserved.