![]()
You can now start the database server using: pg_ctl -D /var/lib/postgresql/11/data -l logfile start WARNING: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or -auth-local and -auth-host, the next time you run initdb. ok performing post-bootstrap initialization. 128MB selecting dynamic shared memory implementation. fixing permissions on existing directory /var/lib/postgresql/11/data. The default text search configuration will be set to "english". The default database encoding has accordingly been set to "UTF8". The database cluster will be initialized with locale "en_US.utf8". This user must also own the server process. $ docker run -rm -v " $PWD ":/var/lib/postgresql tianon/postgres-upgrade:10-to-11 -link The files belonging to this database system will be owned by user "postgres". $ docker logs -tail=1 psql 21:34:50.489 UTC LOG: database system is ready to accept connections $ docker pull tianon/postgres-upgrade:10-to-11 10-to-11: Pulling from tianon/postgres-upgrade Digest: sha256:ce4cacad5419bceaf975c09ab9f397d3f0ce9e29e13b2097f799f3af14cdf7b3 Status: Image is up to date for tianon/postgres-upgrade:10-to-11 Why am I getting this error? The role exists, or at least it seems it to me.$ docker pull postgres:10 10: Pulling from library/postgres Digest: sha256:6222435cc15460634d6a59499a66db3181162cfa27448dbbdc65c07ccbeb8b88 Status: Image is up to date for postgres:10 I do the same with PSequal.app, says the same thing, $ psql: FATAL: role "ming" does not exist $ psql: FATAL: role "postgres" does not exist My plan is to use this database on docker with Django, so first want to check I can connect, but I cant. Postgres=# GRANT ALL PRIVILEGES ON DATABASE youtube TO ming #Sqlpro for postgres role does not exist password#Postgres=# CREATE ROLE ming WITH LOGIN PASSWORD 'pass1234' I downloaded the docker container for postgres:, and did the following: $ docker run -name satgres -e POSTGRES_PASSWORD=mysecretpassword -d -p 5432:5432 postgres Psql: FATAL: role "postgres" does not exist $ docker exec -it docker_database_1 psql -U georchestraĪnd of course, trying to connect with the user postgres causes an error: docker exec -it docker_database_1 psql -U postgres HEALTHCHECK -interval=30s -timeout=30s \Ĭonsequently, you will have to use the option "-U georchestra" to connect to the container. Lhe developers chose the user georchestra in the geOrchestra docker composition.Įxtract from the dockerfile: environment: In my case, the problem may be due also to the use of a super user who is not postgres. Because this was all done in the background, it didn't occur to me that this was the problem as none of the usual errors popped up to inform that the port was being used, etc. ![]() ![]() #Sqlpro for postgres role does not exist install#One thing that I didn't realise, is that on Mac, doing the above will not only install required libraries, but also start a database on :5432. Now, on a Mac, you will need to do the same with brew: brew install postgresql This is because psycopg2 requires an operating system install of the postgres libraries: yum install postgresql-devel Usually running through docker, using python and connecting to a postgres database requires you to install psycopg2, via pip3 install psycopg2, but if you run this command you will get: Error: pg_config executable not found. This question recently passed 10,000 views, so I thought I should elaborate more on why this happened. So I remembered I installed it via, I ran $ pg-stopĪnd then I had no problem connecting to the Docker instance. The problem was simple enough that my computer was already running an instance of Postgres that I was not aware was still running (not inside Docker) on :5432, checked with: $ lsof -n -i:5432 | grep LISTEN ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |