diff options
author | Robert Haas <rhaas@postgresql.org> | 2015-04-02 10:10:22 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2015-04-02 10:10:22 -0400 |
commit | 4cd639baf4bd35dd7fc924009203349b81bdcd68 (patch) | |
tree | 257af95aee58af4bc460a73e4224b4609f9b8c5f /src/common/connstrings.c | |
parent | 7dae3cf68cf59c37163df42fb0d2b66fed9996f4 (diff) | |
download | postgresql-4cd639baf4bd35dd7fc924009203349b81bdcd68.tar.gz postgresql-4cd639baf4bd35dd7fc924009203349b81bdcd68.zip |
Revert "psql: fix \connect with URIs and conninfo strings"
This reverts commit fcef1617295c074f2684c887627184d2fc26ac04, about
which both the buildfarm and my local machine are very unhappy.
Diffstat (limited to 'src/common/connstrings.c')
-rw-r--r-- | src/common/connstrings.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/src/common/connstrings.c b/src/common/connstrings.c deleted file mode 100644 index 91170a18847..00000000000 --- a/src/common/connstrings.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * connstrings.c - * connecting string processing functions - * - * Copyright (c) 2012-2015, PostgreSQL Global Development Group - * - * src/include/common/connstrings.c - */ -#include "postgres_fe.h" - -#include <string.h> - -#include "common/connstrings.h" - - -/* The connection URI must start with either of the following designators: */ -static const char uri_designator[] = "postgresql://"; -static const char short_uri_designator[] = "postgres://"; - - -/* - * Checks if connection string starts with either of the valid URI prefix - * designators. - * - * Returns the URI prefix length, 0 if the string doesn't contain a URI prefix. - */ -int -libpq_connstring_uri_prefix_length(const char *connstr) -{ - if (strncmp(connstr, uri_designator, - sizeof(uri_designator) - 1) == 0) - return sizeof(uri_designator) - 1; - - if (strncmp(connstr, short_uri_designator, - sizeof(short_uri_designator) - 1) == 0) - return sizeof(short_uri_designator) - 1; - - return 0; -} - -/* - * Recognized connection string either starts with a valid URI prefix or - * contains a "=" in it. - * - * Must be consistent with parse_connection_string: anything for which this - * returns true should at least look like it's parseable by that routine. - */ -bool -libpq_connstring_is_recognized(const char *connstr) -{ - return libpq_connstring_uri_prefix_length(connstr) != 0 || - strchr(connstr, '=') != NULL; -} |