0

I dropped my database that I had previously created for django using :
dropdb <database>

but when I go to the psql prompt and say \d, I still see the relations there :

How do I remove everything from postgres so that I can do everything from scratch ?

5
  • Are you connecting to a different database than you think? psql -l will show you all the ones you have—if you see more than you expect, this could be the problem. Commented Feb 14, 2013 at 7:36
  • nope. I am not, just checked. All I want now is to reset the postgres to the point I installed it Commented Feb 14, 2013 at 7:38
  • You didn't drop the database then. Commented Feb 14, 2013 at 7:39
  • I did, and then I created again, but doesn't dropping the database once mean that I am also dropping the tables ? Commented Feb 14, 2013 at 7:44
  • How you can be so sure that you really dropped it? What if dropdb failed because of lack of permissions? Commented Feb 14, 2013 at 7:48

2 Answers 2

1

Most likely somewhere along the line, you created your objects in the template1 database (or in older versions the postgres database) and every time you create a new db i thas all those objects in it. You can either drop the template1 / postgres database and recreate it or connect to it and drop all those objects by hand.

Sign up to request clarification or add additional context in comments.

Comments

0

Chances are that you never created the tables in the correct schema in the first place. Either that or your dropdb failed to complete.

Try to drop the database again and see what it says. If that appears to work then go in to postgres and type \l, putting the output here.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.