Altering tables in postgres

I think the information you are able to provide to us (and likewise us to you) would be a good topic for an RFC: GitHub - strapi/rfcs: RFCs for Strapi future changes

First off please forgive my ignorance when it comes to complex PostgreSQL DBA topics, I am more of a MySQL/MariaDB guy myself, you are probably far more knowledgeable there :slight_smile:

  1. I absolutely agree that data integrity is a great thing, almost all of our supported databases have at least some method to do so (Yes even MongoDB :laughing:)
    1a. Regarding primary keys, currently we don’t allow customization of this due to some hard coded variables, although we do plan to add this back in (it was removed when we went from beta => stable). This is more so a refactor of the database layer which we have planned this quarter: Database layer (v4) - Roadmap | Product Roadmap however we are determining the scope of that.
    2a. I’m not sure I fully understand the composite unique constraints, could you give me a brief summery? We do already add in some unique constraints.
  2. Shared tables might a bit more complex topic once we plan to introduce the multi-tenancy feature, for the moment we don’t really have any suggestions on this :thinking: however I do agree the row level security policies would be awesome to have, the only caveat is when we add features, we generally require that all of our supported databases must also be included in at least some capacity. If this can’t be done at the database level for every database then it’s implemented at the application layer. (Where possible, we try to keep the split between SQL and NoSQL as minimal as possible).
  3. This one I’m not entirely sure I agree with, but I’m largely unfamiliar with PG clusters and have more experience in MariaDB Galera clusters where DB Host <=> DB Host IO isn’t really all that difficult since every read and write node are all kept in sync and a single query won’t leave the DB Host it originally connected with.