aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/interfaces/libpq/fe-connect.c4
-rw-r--r--src/interfaces/libpq/t/001_uri.pl4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 51083dcfd8e..aaf87e8e885 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -6825,7 +6825,9 @@ end:
/* Not at the end of the string yet? Fail. */
if (*q != '\0')
{
- libpq_append_error(errorMessage, "trailing data found: \"%s\"", str);
+ libpq_append_error(errorMessage,
+ "unexpected spaces found in \"%s\", use percent-encoded spaces (%%20) instead",
+ str);
free(buf);
return NULL;
}
diff --git a/src/interfaces/libpq/t/001_uri.pl b/src/interfaces/libpq/t/001_uri.pl
index 27cf67ae800..2de2073e0a9 100644
--- a/src/interfaces/libpq/t/001_uri.pl
+++ b/src/interfaces/libpq/t/001_uri.pl
@@ -96,13 +96,13 @@ my @tests = (
# Trailing data in parameter.
q{postgresql://host? user user = uri & port = 12345 12 },
q{},
- q{libpq_uri_regress: trailing data found: " user user "},
+ q{libpq_uri_regress: unexpected spaces found in " user user ", use percent-encoded spaces (%20) instead},
],
[
# Trailing data in value.
q{postgresql://host? user = uri-user & port = 12345 12 },
q{},
- q{libpq_uri_regress: trailing data found: " 12345 12 "},
+ q{libpq_uri_regress: unexpected spaces found in " 12345 12 ", use percent-encoded spaces (%20) instead},
],
[ q{postgresql://host?}, q{host='host' (inet)}, q{}, ],
[