diff --git a/src/bin/scripts/pg_isready.c b/src/bin/scripts/pg_isready.c
new file mode 100644
index 4ba257d..f316a36
*** a/src/bin/scripts/pg_isready.c
--- b/src/bin/scripts/pg_isready.c
***************
*** 17,22 ****
--- 17,27 ----
  static void
  help(const char *progname);
  
+ static void
+ set_connect_options(PQconninfoOption *conninfo, const char **dbname,
+ 				const char **host, const char **port,
+ 				const char **conn_to, const char **user);
+ 
  int
  main(int argc, char **argv)
  {
*************** main(int argc, char **argv)
*** 62,68 ****
  		switch (c)
  		{
  			case 'd':
! 				pgdbname = pg_strdup(optarg);
  				break;
  			case 'h':
  				pghost = pg_strdup(optarg);
--- 67,77 ----
  		switch (c)
  		{
  			case 'd':
! 				connect_options = PQconninfoParse(optarg, NULL);
! 				if (connect_options)
! 					set_connect_options(connect_options, &pgdbname, &pghost, &pgport, &connect_timeout, &pguser);
! 				else
! 					pgdbname = pg_strdup(optarg);
  				break;
  			case 'h':
  				pghost = pg_strdup(optarg);
*************** help(const char *progname)
*** 206,208 ****
--- 215,244 ----
  	printf(_("  -U, --username=USERNAME  database username\n"));
  	printf(_("\nReport bugs to <pgsql-bugs@postgresql.org>.\n"));
  }
+ 
+ static void
+ set_connect_options(PQconninfoOption *conninfo, const char **dbname,
+ 				const char **host, const char **port,
+ 				const char **conn_to, const char **user)
+ {
+ 	PQconninfoOption *opts;
+ 
+ 	for (opts = conninfo; opts->keyword; opts++)
+ 	{
+ 		if (opts->val)
+ 		{
+ 			if (strcmp(opts->keyword, "dbname") == 0)
+ 				*dbname = pg_strdup(opts->val);
+ 			else if (strcmp(opts->keyword, "host") == 0)
+ 				*host = pg_strdup(opts->val);
+ 			else if (strcmp(opts->keyword, "port") == 0)
+ 				*port = pg_strdup(opts->val);
+ 			else if (strcmp(opts->keyword, "connect_timeout") == 0)
+ 				*conn_to = pg_strdup(opts->val);
+ 			else if (strcmp(opts->keyword, "user") == 0)
+ 				*user = pg_strdup(opts->val);
+ 		}
+ 	}
+ 
+ 	PQconninfoFree(conninfo);
+ }
