-
Notifications
You must be signed in to change notification settings - Fork 8
PG-1537 Error on required arguments #267
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
base: TDE_REL_17_STABLE
Are you sure you want to change the base?
PG-1537 Error on required arguments #267
Conversation
Codecov ReportAttention: Patch coverage is
❌ Your project status has failed because the head coverage (78.36%) is below the target coverage (90.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## TDE_REL_17_STABLE #267 +/- ##
=====================================================
+ Coverage 78.34% 78.36% +0.02%
=====================================================
Files 22 22
Lines 2484 2482 -2
Branches 391 393 +2
=====================================================
- Hits 1946 1945 -1
+ Misses 462 461 -1
Partials 76 76
🚀 New features to boost your workflow:
|
Sort declarations and visually separate static functions from user facing functions.
Seems like these should belong in the same file as the functions for creating and modifying these entries.
Move the argument parsing to the _internal function so validation only have to be done there.
We should reject both null and the empty string in many of our user facing functions.
Previously these simply crashed the server on NULL input, require these parameters to be non-null, and also do not accept the empty string.
Passing NULL here crashed the server. Also do not accept the empty string.
3f5fb21
to
ddd2519
Compare
|
||
if (!PG_ARGISNULL(arg_num)) | ||
{ | ||
value = text_to_cstring(PG_GETARG_TEXT_PP(arg_num)); |
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.
Shouldn't we have a separate error message for this, e.g. like the below?
# SELECT * FROM pg_create_physical_replication_slot('');
ERROR: replication slot name "" is too short
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.
I'm not sure I see the value in that. But we can if we want to! :)
If we do that we should probably only do it when creating stuff and accept the empty string (and never find anything) when looking things up.
Do not accept NULL or the empty string for required arguments in our user facing functions.
I'm a bit unsure of where the helper
required_text_argument()
belongs, any input is appreciated.