Daml on Postgres specific Flyway DB user and App Datasource user

Hi,

I’m trying to find some documentation about a way to have 2 different users on Daml on postgres.

Basically we would like to have 1 user for Flyway that will be granted to execute schema operations like Create, Delete tables, and another one for the application, that will be able to do data operations like insert, update, etc… but not been able to create and delete tables.

Hi @Alex_Martinez_Vila,

If I understand your request correctly, this is already supported by the PostgreSQL driver. As described in this document, you can run the JAR file with --sql-start-mode migrate-only & your first, highly-permissioned user to just do the table creation/update operations, and then run again with --sql-start-mode migrate-and-start (or not passing the option at all, as that is the default behaviour) with your more restricted user, and, provided the schema is already created, this will not make any table operations.

1 Like

Thank you very much , I think it’s what I was looking for as long as migrate-and-start is not failing on checking data in flyway tables.