Comments (8)
@LaurentGoderre, yes. you see I need to initialize the db to have a postgres role even when the datadir already exists (a.k.a the db already initialized)
from postgres.
If you want a solution that does something with a started database (like our existing initdb scripts do), see #173, #821, #191, #929 for some other issues that have some good thoughts / suggestions (one of which this is probably a duplicate of).
from postgres.
Hi @tianon! Thanks for your response.
I managed to run an init script on my db but it fails with role "postgres" does not exist
(it was probably deleted).
I don't know what roles the db has and I want to use the init script to verify the postgres
role exists (and if not to create one).
from postgres.
You can run
docker exec -u postgres -it postgres psql
psql (16.2 (Debian 16.2-1.pgdg120+2))
Type "help" for help.
postgres=# \du
List of roles
Role name | Attributes
-----------+------------------------------------------------------------
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS
from postgres.
Hi @LaurentGoderre unfortunately your solution would not work in my case because there is no role postgres
so I'm unable to execute any command with -u postgres, that's why I would like to init the db with a postgres
role creation
from postgres.
@tomera-cyera I believe postgres
in this case refers to the OS user which is postgres
not the db role.
from postgres.
No, I refer to the postgres
db role in case I initialize the container with data-dir that does not have the role postgres I want to make sure the postgres
role will be created if not exist
@LaurentGoderre
from postgres.
OOh you mean at initialization?
from postgres.
Related Issues (20)
- Postgres container fails to start due to permissions issue HOT 1
- "Can't execute 'bash' error" on Alpine image HOT 1
- Unable to connect to PostgreSQL server: FATAL: password authentication failed for user "smartloy_user" HOT 6
- Critical/High Severity issues reported by Snyk for postgres:15.6 HOT 2
- Add an option to skip DB init check HOT 2
- Postgres Auto Dropping the DB Randomly - database "template0" is not currently accepting connections HOT 2
- Multiple CVEs flagged by JFrog for postgres:14 HOT 3
- Unable to override login credentials for already initialized database HOT 6
- SQL files under docker-entrypoint-initdb.d are not executed even if data directory is not initialized HOT 1
- Secrets file not detected on startup HOT 2
- Failure oracle-libs installation
- Skip postgres restart on first run HOT 1
- Reproducible SIGSEGV in query HOT 1
- Separating config using PGDATA does not seem to behave as described in the docs HOT 12
- Upgrade older images to OCI Format or Docker Image manifest v2, schema 2 HOT 3
- Add a HEALTHCHECK to the images HOT 2
- include_dirs env var HOT 4
- Add "build from github.com/postgres/postgres" variation HOT 2
- PostgreSQL 17beta1 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postgres.