User-Defined Function (UDF)
Definition
A user-defined function extends a system with self-defined calculation logic.
In databases, a UDF can take input values and calculate a value or result set from them. Language, execution rights, and allowed side effects depend on the system.
Simply explained
Like a custom calculation rule that is then reused under a name.
Why it matters in practice
Recurring calculations can be maintained centrally and uniformly.
Example from business
Hypothetical example: A database function calculates an internally defined discount level.
Limits and pitfalls
- Slow functions can slow down queries; privileged execution can grant unnecessary rights.
Origin & history
UDFs originated as an extension capability for programmable database and analytics systems.
Use in mid-sized companies
- Centralize recurring conversions and data cleansing.
Frequently asked questions
Is a UDF the same as a complete application?
No, it is a callable function module.
Sources
- User-Defined Functions · PostgreSQL: User-Defined Functions –
Editorially reviewed on: