Having trouble using PostgreSQL database with Django and Windows 10

402 views Asked by At

I have just installed PostgreSQL database on my Windows 10 system. I successfully set PostgreSQL as my default database in Django and that worked too.

Now the problem is that want to create new database to use, but do not know how. I have several questions:

  1. I know how to create a database from pg4admin but not sure what password and username should I use for that database?
  2. What does this command mean: psql -U postgres?
  3. What is superuser?
  4. How do you create a new superuser?
  5. What password should I use for the newly created database?
1

There are 1 answers

0
Scott Skiles On

I know how to create a database from pg4admin but not sure what password and username should i use for that database?

Why don't you just use pgAdmin4? In any case, you can use literally whatever username and password you want so long as (1) you remember them; (2) the password is strong (and preferably easy to remember).

What does this command mean: psql -U postgres?

via: http://postgresguide.com/utilities/psql.html:

  • Psql is the interactive terminal for working with Postgres.
  • -U the user to connect with

What is superuser?

Django superuser or Postgres superuser? Either way, please take the time to learn more about what you're doing or else it is not going to end well.

How do you create a new superuser?

Please see Django/Postgres documentation above. Ask a separate question if you have issues.

What password should I use for the newly created database?

Here is a Lifehacker post on how to create a password.

For the record, this is a very poor quality question. Please put in more effort on your own next time. I understand you're starting out, but it seems like you're going a little too fast. Slow down and really take the time to thoroughly learn about the tools you're using. And please do more research on your own to avoid wasting others' time in the future.