Hello,
I have the following scenario:
- RDS instance is created in PostgreSQL
- Database created: "example_app"
- Vault connection string (written in ruby) for PostgreSQL RDS instance:
- 'postgresql' => "postgresql://#{ds_username}:#{ds_password}@#{ds_host}:#{datastore_ports[ds_engine]}/#{ds_database}"
- PostgreSQL for granting access
- 'postgresql' => "CREATE ROLE \"{{name}}\" WITH LOGIN PASSWORD '{{password}}';" \ "GRANT #{privileges} ON ALL TABLES IN SCHEMA public TO \"{{name}}\";"
This is failing with "pq: permission denied for relation schema_migrations"
So in summary I want to be able to use my root psql account to create a user on the instance and then grant that user full access to the database that is tied to that application, and I am struggling to come up with the SQL to do that. In MySQL I had an easy time of this. Not so in PostgreSQL.
I believe that outside of Vault I'd simply use two separate connection strings: one to create the user and the other to modify the schema permissions of the other database, but I am unsure how to accomplish this with a single connection string.