POSTGRESQL 无法创建数据库 出现类似createdb: could not connect to database postgres: FATAL: role “XXXX” does not exist

I figured I’d share getting setup on my Ubuntu machine.

Installing

Creating User

The bit above can be resolved with the following (replacing myusername for yours)

Then this should work

Installing Extensions
There should be more problems when trying to create the 5 extensions

You can fix it by just downloading a package.

Downloading the postgresql-contrib packages will give the ability to use the following five commands:

And now you should be good to go!

Thanks to the post by Tanner Watson for the CREATE EXTENSION command

Leave a Reply

Your email address will not be published.