diff options
author | Robert Haas <rhaas@postgresql.org> | 2012-06-08 08:46:39 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2012-06-08 08:47:24 -0400 |
commit | 3b5548a3d524e3b37d49f79f707d2119ecdfa303 (patch) | |
tree | 0a3bcb5b9aece4dca0e0485e413293caf02114bc /src | |
parent | f1438cf5c6f54d0a887c7fbef91163efda5daa0f (diff) | |
download | postgresql-3b5548a3d524e3b37d49f79f707d2119ecdfa303.tar.gz postgresql-3b5548a3d524e3b37d49f79f707d2119ecdfa303.zip |
When using libpq URI syntax, error out on invalid parameter names.
Dan Farina
Diffstat (limited to 'src')
-rw-r--r-- | src/interfaces/libpq/fe-connect.c | 8 | ||||
-rw-r--r-- | src/interfaces/libpq/test/expected.out | 8 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 960811f233e..33daaec7be4 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -4874,9 +4874,11 @@ conninfo_uri_parse_params(char *params, return false; } - fprintf(stderr, - libpq_gettext("WARNING: ignoring unrecognized URI query parameter: %s\n"), - keyword); + printfPQExpBuffer(errorMessage, + libpq_gettext( + "invalid URI query parameter \"%s\"\n"), + keyword); + return false; } if (malloced) { diff --git a/src/interfaces/libpq/test/expected.out b/src/interfaces/libpq/test/expected.out index 6d5077d7623..cc22a96890a 100644 --- a/src/interfaces/libpq/test/expected.out +++ b/src/interfaces/libpq/test/expected.out @@ -59,8 +59,8 @@ trying postgresql://host/db?u%73er=someotheruser&port=12345 user='someotheruser' dbname='db' host='host' port='12345' (inet) trying postgresql://host/db?u%7aer=someotheruser&port=12345 -WARNING: ignoring unrecognized URI query parameter: uzer -dbname='db' host='host' port='12345' (inet) +uri-regress: invalid URI query parameter "uzer" + trying postgresql://host:12345?user=uri-user user='uri-user' host='host' port='12345' (inet) @@ -102,8 +102,8 @@ trying postgres://?host=/path/to/socket/dir host='/path/to/socket/dir' (local) trying postgresql://host?uzer= -WARNING: ignoring unrecognized URI query parameter: uzer -host='host' (inet) +uri-regress: invalid URI query parameter "uzer" + trying postgre:// uri-regress: missing "=" after "postgre://" in connection info string |