Forum OpenACS Q&A: Dropping database in Postgres

Collapse
Posted by sagnik nandy on
I recently installed Postgres using RPMs. The problem that I am coming
up against is that "dropdb" doesn't seem to work for me. So, while I
can go on creating using "createdb", I cant get rid of databases.

There's something else, as well...as I mentioned, my installation was
done using RPMs. Now, I have no idea where the data is stored. So, I
cant figure out how to go about creating a new user!

Please Help!!!

Collapse
Posted by Kenny Chan on
First off, to dropdb, you should su to the owner of the database (su nsadmin), if still fails (which is VERY unlikely), you should be able to do it with the user "postgres". If don't know / not sure about the passwords for these users, try su to root and then su to these users, that way you only need the root password. Try "dropdb openacs" again when you are clear what user you are running the command in (the database name for the RPM installation is "openacs")

What do you mean by creating a new user in your 2nd question? If you mean creating database user, there is no such need. The RPM installation default checked and created two users for you: "postgres" and "nsadmin". "postgres" is the super user for the postgreSQL database while "nsadmin" is the owner of the "openacs" database, which is where all the openacs data being stored. If you want to list the database tables, "su nsadmin" and "psql openacs", that will give you the psql prompt. You can then "d" and display a list of database tables in the Openacs installation.

If you mean creating new ACS users... just go to your site's URL and the appropriate port (most likely 8080 if you use everything default for the RPM)

Hope this help.

Collapse
Posted by Abha B. on
Thanx for the response!!! The RPM I used are "postgresql-6.5.3-6i386.rpm", "postgresql-devel-6.5.3-6i386.rpm", "postgresql-server-6.5.3-6i386.rpm" and "postgresql-test-6.5.3-6i386.rpm". These created a default superuser called "postgres", which I get to through root! The dropping database worked (I used destroydb ***), but, I am still hazy about how to create a new user for the database. Not an ACS user...but, a DB user, like postgres. Mind you, I have not installed OpenACS or even the Postgres drivers, yet!!! Can you help me with this! Its actually more of a conceptual query on my part, than a real problem with my system!!!
Collapse
Posted by Kenny Chan on
Hi Abha,

To create a db user, "su postgres" and then "createuser". You are right that it is more of a conceptual problem than the system problem. You might want to consider reading all the documentations carefully before you post questions.

As the words on the RPM page says, the RPMs are intended to facilitate quick re-installation of OpenACS for those who already read / understand the documentations.

So please do some reading.

Sincerely,