Skip to content

Conversation

@benbellick
Copy link
Member

closes #928

@benbellick benbellick changed the title docs: give default value for parameterConsistency feat: default value for parameterConsistency Jan 7, 2026
@benbellick benbellick marked this pull request as ready for review January 7, 2026 14:08
- value: any1
variadic:
min: 2
parameterConsistency: CONSISTENT
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this to the docs in the note part of scalar_functions.md, but I believe that consistent vs inconsistent doesn't matter here. This is because any1 in the return type pins the argument.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I actually ended up removing this line. It falsely communicates to the user that parameterConsistency set to CONSISTENT is an important attribute here. In actuality, the any1 value is pinned by the return type, so all of them MUST be fixed, regardless of the parameterConsistency setting.

As part of this PR, I wanted to try and come up with some useful and standard scalar functions to add to the core extension set that demonstrate the use of both values of parameterConsistency, but I couldn't think of any or find any off the internet. This was introduced in 2021. Perhaps we should discuss if this feature is worth supporting?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay actually, I found postgresql's JSON_BUILD_OBJECT, which is an example of a function where variadic INCONSISTENT behavior is desirable.

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.

clarify default behavior of parameterConsistency or require parameter

3 participants