Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify the function parsing regex #358

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tommyzli
Copy link
Contributor

@tommyzli tommyzli commented Oct 8, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants