-- Run: -- su - -- su - postgres -- psql template1 -- We are now connected to the "template1" database, as user "postgres" -- Run the following commands. If you are running Postgres 8.1, run CREATE PROCEDURAL LANGUAGE 'plpgsql' -- Alternatively, for any version of Postgres, run CREATE FUNCTION plpgsql_call_handler() RETURNS OPAQUE AS '/usr/lib/postgresql/8.1/lib/plpgsql.so' LANGUAGE 'C'; CREATE LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler LANCOMPILER 'PL/pgSQL'; -- This does exactly the same thing, but requires more typing. What -- this does is makes the 'PL/pgSQL' procedural language available in -- all new databases we create (a new database is created from the -- template1 database template), so anything we create in template1 -- appears in a new database. -- Next, while you are still running as the user "postgres", run -- createuser -P -- You will be prompted for a username and a password. Like the -- difference between root and normal system users, the "postgres" -- user is the database owner, but you will want to create a normal -- account for day-to-day usage, and just use the postgres user for -- database administration (backups, upgrades, user creation etc.). I -- recommend that you use the same name as your system username, -- though this is not required is is the default used by the psql -- command.