-
Bug
-
Resolution: Done
-
Major
-
crc-2022-11-17
-
False
-
-
False
-
-
Description
A recent migration ran ok on CRC stage but hit error on CRC prod:
Running migrations: Applying ansible.0046_add_fulltext_search_fix...Traceback (most recent call last): File "/venv/lib64/python3.8/site-packages/django/db/backends/utils.py", line 82, in _execute return self.cursor.execute(sql) psycopg2.errors.InsufficientPrivilege: must be owner of function update_collection_ts_vector
Stage and prod use the user `postgres`. Running queries against stage and prod found
Stage:
proname | proowner ----------------------------+---------- update_collection_ts_vector | postgres
Prod:
proname | proowner ----------------------------+---------- update_collection_ts_vector | galaxy_ng
Prod also has a mix of `tableowners` between `postgres` and `galaxy_ng`, with owner `galaxy_ng` for models with an older creation date, and `postgres` for models with a newer creation date.
Solution
This can likely be resolved by changing the owner of function `update_collection_ts_vector` to `postgres`