Open Osama-Kassem opened 19 hours ago
Thank you for reporting us your feedback!
The internal ticket has been created: https://warthogs.atlassian.net/browse/DPE-6031.
This message was autogenerated
Hi, @Osama-Kassem, is this a blocking issue for you? I'm looking into splitting the alter statement by type.
Steps to reproduce
add_history_tracing_columns
in my case)The charm should try transferring ownership of everything under the
public
schema to the new relation user, but it fails at transferring ownership of the procedure and the app is stuck inFailed to initialize database relation
Expected behavior
The query executed should be
ALTER PROCEDURE public."add_history_tracing_columns"(IN _table_name text) OWNER TO "relation_id_15";
Actual behavior
ALTER FUNCTION public."add_history_tracing_columns"(IN _table_name text) OWNER TO "relation_id_15";
Versions
Operating system: Ubuntu 24.04.1 LTS
Juju CLI: 3.4.6-genericlinux-amd64
Juju agent: 3.4.6
Charm revision: 444
microk8s: MicroK8s v1.29.10 revision 7396
Log output
Juju debug log:
Additional context
It seems like the root cause of the error is here: https://github.com/canonical/postgresql-k8s-operator/blob/2a7f044766faa9d2873cc2486f6e3af72324ce24/lib/charms/postgresql_k8s/v0/postgresql.py#L377-L378
The
_generate_database_privileges_statements
function considers everything under thepg_proc
table as a function and generates theALTER FUNCTION ... OWNER TO ...
queries, but thepg_proc
table also contains procedures (and aggregate and window functions).Additionally, this also happens to the PostgresQL VM charm, should I create a bug report there as well?