-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
bugfix: arguments with null default were required #509
Conversation
let trimmed = default_str.trim(); | ||
if trimmed.starts_with("NULL::") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you confident this is always reliable wrt uppercase/lowercase? Will it alway be cast with a ::
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you confident this is always reliable wrt uppercase/lowercase?
Yes, Postgres converts all cases into capitals. Added a test for this.
Will it alway be cast with a ::?
A <arg> <type> default null
form is always converted into a cast of the form NULL::<type>
. Other, more complex forms of expressions might not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also updated docs with the caveat that only simple default null
are supported for now.
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
UDF args with a default value of null were either required or had a default value of "NULL" in case of string.
What is the new behavior?
UDF args with a null default value will be optional.
Additional context
Fixes #507