PostgreSql Error
Closed. Error @ http://www.linuxquestions.org/questi....php?p=2445805
|
Help pls? =\
|
Hi coolrock,
Looks like those Netdisco scripts expect the PostgreSQL command line utilities to be in your path. The default directory for a PostgreSQL installation is /usr/local/pgsql, so you can either add /usr/local/pgsql/bin to your PATH, or modify the Netdisco scripts to reference those commands at their full path. |
Hmm, how do I go around adding it into my PATH? :o
Quote:
|
I also found the CREATEUSER executable at /usr/src/postgresql-8.1.4/src/bin/scripts
Advice pls? Thanks in advance. Jason *UPDATE: undo the changes. trying out etrumbo's help |
Hi coolrock,
Sorry, I should have offered more detail. First, let's find out where your PostgreSQL is installed. The first Netdisco script was calling the 'createdb' and 'createuser' commands, so we'll look in the standard location for these files. From a terminal, run: ls /usr/local/pgsql/bin If you get a file list that includes createuser and createdb, then we've found it and we can continue. Next, run this from your terminal: export PATH=$PATH:/usr/local/pgsql/bin Now try that first Netdisco script. If it works now, we'll have to make that path change permanent (the above step is temporary). In your home directory, use your preferred editor to edit (or create, if it doesn't exist) the file '.bash.profile'. Add that 'export ...' command from above to .bash_profile and save it, then it will take effect each time you log in. |
Hi coolrock,
I just saw your updates to your posts. It seems that you have yet to install and run PostgreSQL, and this Netdisco is expecting that. Go to that /usr/src/postgres... directory and follow the instructions for installing PostgreSQL. Once that's done, you can proceed to Netdisco setup. |
Hi etrumbo,
Thanks for the quick reply. When you point to home directory, is it the directory I am in right after i log in? /home/tech. Quote:
root@nimrod3:/usr/local/netdisco/sql# ls /usr/local/pgsql/bin clusterdb createuser dropuser ipcclean pg_ctl pg_resetxlog postmaster vacuumdb createdb dropdb ecpg pg_config pg_dump pg_restore psql createlang droplang initdb pg_controldata pg_dumpall postgres reindexdb root@nimrod3:/usr/local/netdisco/sql# export PATH=$PATH:/usr/local/pgsql/bin root@nimrod3:/usr/local/netdisco/sql# ./pg_init --> Creating User netdisco. Choose a password just for this new database user. /bin/bash: createuser: command not found Creating Database netdisco. Use the Password used above. /bin/bash: createdb: command not found Still the same :) |
To provide more information for assistance, here's where I locate createuser and createdb
root@nimrod3:/usr/local/netdisco/sql# locate createuser /usr/src/postgresql-8.1.4/doc/src/sgml/ref/createuser.sgml /usr/src/postgresql-8.1.4/doc/man1/createuser.1 /usr/src/postgresql-8.1.4/src/bin/scripts/createuser /usr/src/postgresql-8.1.4/src/bin/scripts/createuser.c /usr/src/postgresql-8.1.4/src/bin/scripts/createuser.o /usr/local/pgsql/bin/createuser /usr/local/pgsql/doc/html/sql-createuser.html /usr/local/pgsql/doc/html/app-createuser.html /usr/local/pgsql/man/man1/createuser.1 root@nimrod3:/usr/local/netdisco/sql# locate createdb /usr/src/postgresql-8.1.4/doc/src/sgml/ref/createdb.sgml /usr/src/postgresql-8.1.4/doc/man1/createdb.1 /usr/src/postgresql-8.1.4/src/bin/scripts/createdb.c /usr/src/postgresql-8.1.4/src/bin/scripts/createdb.o /usr/src/postgresql-8.1.4/src/bin/scripts/createdb /usr/local/pgsql/bin/createdb /usr/local/pgsql/doc/html/tutorial-createdb.html /usr/local/pgsql/doc/html/manage-ag-createdb.html /usr/local/pgsql/doc/html/app-createdb.html /usr/local/pgsql/man/man1/createdb.1 |
I managed to run createuser in the command line interface, but not by running the ./pg_init. However I still experience errors, Any pros/veteran in this field can lend me a hand or some advices?
root@nimrod3:/usr/local/netdisco/sql# createuser Enter name of role to add: test Shall the new role be a superuser? (y/n) n Shall the new role be allowed to create databases? (y/n) n Shall the new role be allowed to create more new roles? (y/n) n createuser: could not connect to database postgres: could not connect to server: No such file or dir ectory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? Thanks in advance. |
If pg_init is a script (and stupidly enough assumes createuser to be in
a different place OR switches to a different user as it goes), edit it respectively :} Cheers, Tink |
Hi coolrock,
OK, based on post #9 I can see that PostgreSQL is installed and in the standard location, but the other errors you're getting indicate that PostgreSQL isn't running. So, refer to the INSTALL file in your /usr/src/postgres... directory. That begins with a Quick Install section which just lists the commands to go from a source download to a tested installation of Postgres. It looks like you've already done everything up through 'gmake install', at least. By following those quick install directions from that point, you'll set up and launch (temporarily) the 'postmaster' server process that handles connections to Postgres. If that works, you'll want to make Postgres start automatically at each boot. Go to the /usr/src/postgres... directory and find the subdirectory contrib/start-scripts, there should be a file called 'linux'. Copy this to /etc/rc.d/rc.pgsql, make it executable (chmod 755 rc.pgsql), and add a reference to it in your /etc/rc.d/rc.local like this: if [ -x /etc/rc.d/rc.pgsql ]; then /etc/rc.d/rc.pgsql start fi |
Quote:
Thanks in advance Jason |
It should be in the same location as createuser. But that's not the
error you're getting from your pg_init. It can't find createuser; chances are that it's hardcoded; looking for a different location. See my previous post. Cheers, Tink |
Quote:
Thanks in advance. Jason |
All times are GMT -5. The time now is 10:25 AM. |