The regex to extract the function attributes relies on pg_get_functiondef to return the attributes in a specific order of IMMUTABLE/STABLE, then PARALLEL SAFE/RESTRICTED, then STRICT, then SECURITY DEFINER. And while the order is preserved across all current versions of Postgres as it is the order generated by the function, I would sleep better at night if these attributes were fetched from the source of truth in pg_proc rather than a regex parser :)
Hello, this is a follow-up to https://github.com/cyrilgdn/terraform-provider-postgresql/pull/307/files
The regex to extract the function attributes relies on
pg_get_functiondef
to return the attributes in a specific order ofIMMUTABLE/STABLE
, thenPARALLEL SAFE/RESTRICTED
, thenSTRICT
, thenSECURITY DEFINER
. And while the order is preserved across all current versions of Postgres as it is the order generated by the function, I would sleep better at night if these attributes were fetched from the source of truth inpg_proc
rather than a regex parser :)