Conversation
catch insert/update failurs on READ-ONLY datbase instance
Contributor
|
Thanks for your contribution! Do you mind creating an upgrade script as well, |
client update script for v1.2
Author
|
Created the client_lockout--1.1--1.2.sql script with the entire function which contains updates. |
adamguo0
reviewed
Mar 21, 2025
| INSERT INTO client_lockout.failed_attempts (user_name, num_failed_attempts) | ||
| VALUES (port.user_name, 1) | ||
| ON CONFLICT (user_name) DO UPDATE SET num_failed_attempts = client_lockout.failed_attempts.num_failed_attempts + 1; | ||
| EXCEPTION |
Contributor
There was a problem hiding this comment.
Tested briefly on PG17 and this part threw a syntax error, I think plpgsql doesn't support exception handling like this? the exception handling should be after the BEGIN block
https://www.postgresql.org/docs/current/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue 296
Description of changes:
I added a READER instance to my Aurora PostgreSQL v15 cluster, but users received an error logging into the READER instance. This update catches the exception and logs a special message to CloudWatch to allow alarms to be triggered if a brute force password attempt was made against a READER instance.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.