0

I'm quite new to PostgreSQL and I'm following a #Udacity course to learn about it.

In the course is mentioned that the default Postgres user is "postgres" so I only need to use the following line to create a DB from the terminal, in order to create a "sample_database_1" database:

createdb sample_database_1

When I do this I get the following error:

createdb: error: no se pudo conectar a la base de datos template1: FATAL:
no existe el rol «jvillarroel»

which means that the user "jvillarroel" (which is the same as my Windows 10 admin session) doesn't exist.

So:

  • How do I change the default user to be "postgres"?
  • What am I doing wrong here?
  • Is some configuration the installation?

Any tip of advice will be very well received.

Regards!

0

1 Answer 1

0

My spanish is a bit rough but it seems as though your connection to the database is the issue

o se pudo conectar a la base de datos template1 = Cant connect to template1 ?

I would guess that you are attempting to connect to the DB using windows authentication and the DB is not configured to handle these requests.

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

4 Comments

Thanks for your answer. What you mentioned, is exactly what It says. But I don't get why it is attempting to connect to the template1 database?
Its probably your connection string if you have anything like this 'postgresql://my-server.com:5432/template_1' then you will be attempting to connect to the server with 0 authentication and using the template_1 db. What does your conn string look like? EDIT: You should add it to the question btw just to clear everything up.
Sorry my inexpertise :S How do I get the connection string?
Depends what software are you using to get here, psql?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.