--- src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java	2002-11-14 06:54:39.000000000 +0100
+++ /home/andreak/postgresql-7.3/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java	2002-12-19 10:31:47.000000000 +0100
@@ -113,6 +113,7 @@
 		PG_USER = info.getProperty("user");
 
 		String password = info.getProperty("password", "");
+		String schema = info.getProperty("schema", "public");
 		PG_PORT = port;
 
 		PG_HOST = host;
@@ -390,6 +391,20 @@
 			{
 				ExecSQL("set autocommit = on; commit;");
 			}
+			acRset.close();
+			String set_schema_cmd = "set search_path TO '"+schema+"'; show search_path";
+			acRset =
+			    ExecSQL(set_schema_cmd);
+			if (! acRset.next())
+			    {
+				throw new PSQLException("postgresql.con.failed", "failed setting search_path for schema: "+schema);
+			    }
+			if (!acRset.getString(1).equals(schema))
+			    {
+				throw new PSQLException("postgresql.con.failed", "Namespace \""+schema+"\" does not exist");
+			    }
+
+			acRset.close();
 		}
 
 		// Initialise object handling
