terraform-provider-postgresql icon indicating copy to clipboard operation
terraform-provider-postgresql copied to clipboard

simplify the function parsing regex

Open tommyzli opened this issue 1 year ago • 0 comments

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 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 :)

tommyzli avatar Oct 08 '23 00:10 tommyzli