/* $Revision: 1.1.1.1 $ $Date: 2003/11/17 21:14:37 $ Become the postgres user in Unix, and then log onto the template1 database as the postgres user to create the bp_sales_match db: prompt> psql template1 postgres # password is postgres */ create database bookstore; \q /* Now, still the postgres user in Unix, log onto the bp_sales_match database as the postgres user to create the bp_sales_match user prompt> psql bookstore postgres */ create user bp_sales_match_user with password 'bp_sales_match_user'; /* Also, still logged onto bp_sales_match as user postgres, if you haven't activated PL/pgSQL, do so now, using the following AS AN EXAMPLE ONLY --- your installation dir may differ. For instance, on RedHat 8.0, the plpgsql library is at '/usr/lib/pgsql/plpgsql.so'. */ -- create function plpgsql_call_handler () returns opaque as '/usr/local/postgresql-7.1.3/lib/plpgsql.so' language 'C'; -- create language 'plpgsql' handler plpgsql_call_handler lancompiler 'PL/pgSQL'; create function plpgsql_call_handler () returns language_handler as '/usr/lib/pgsql/plpgsql.so' language 'C'; -- AT NAVISITE: create function plpgsql_call_handler () returns language_handler as '/u01/POSTGRES/lib/postgresql/plpgsql.so' language 'C'; create language 'plpgsql' handler plpgsql_call_handler lancompiler 'PL/pgSQL'; /* Now it is assumed that either you will do the next steps, or the ISP (such as Naviset or Raqspace) will be able to do this for you, if they have not already: 1. you will restart PostgreSQL to load the bp_sales_match database. 2. you will edit pg_hba.conf (on Red Hat 8.0, this file is located in /var/lib/pgsql/data) so that the bp_sales_match user has is allowed to log onto the bp_sales_match database on your machine, possibly even from remote locations. The following 5 lines of direction are commented out. The security requirement of that only Unix postgres user is allowed to access template1 was too strict. --To only allow non-password access of the Unix postgres user to --the template1 database, comment out this line: --# local all ident sameuser --And put in this line: --local template1 ident sameuser And, we still comment out this line: # local all ident sameuser For local connections to all other databases with password prompt, add this line AFTER the previous line: local all password And for JDBC to make its connections via TCP/IP to the bp_sales_match database, you must add a line similar to host bp_sales_match 127.0.0.1 255.255.255.255 password AFTER both previous lines. NOTE that later versions of PostgreSQL seem to need a restart after editing pg_hba.conf. 3. You will change this line in /var/lib/pgsql/data/postgresql.conf #tcpip_socket = false to this line, telling pg_ctl to allow TCP/IP connexions (such as those initiated by JDBC): tcpip_socket = true and obviously restart after making this change. */