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

Check constraints that depend on UDFs #184

Open
aleclarson opened this issue Dec 5, 2024 · 1 comment
Open

Check constraints that depend on UDFs #184

aleclarson opened this issue Dec 5, 2024 · 1 comment

Comments

@aleclarson
Copy link

Could an option be added to allow these? I realize that pg-schema-diff doesn't parse dependencies of UDFs, but my tool does, so it's not an issue. I also understand that UDF checks are somewhat of a footgun, considering they don't revalidate when changed, but I'd rather allow them than artificially limit what's possible (and I'm using a UDF check in my app!).

// UDF's in check constraints are a bad idea. Check constraints are not re-validated
// if the UDF changes, so it's not really a safe practice. We won't support it for now
if len(con.DependsOnFunctions) > 0 {
return nil, fmt.Errorf("check constraints that depend on UDFs: %w", ErrNotImplemented)
}

@bplunkett-stripe
Copy link
Collaborator

Yes, we can add support for them!

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

No branches or pull requests

2 participants