/// <summary>
        /// Initializes a new instance of the NpgsqlConnectionWithSchema class.
        /// </summary>
        /// <param name="connectionString">The connection string to wrap.</param>
        /// <param name="schema">The schema to select upon opening the connection.</param>
        public NpgsqlConnectionWithSchema(NpgsqlConnectionStringBuilder connectionString, string schema)
            : base(connectionString.Connection())
        {
            if (schema == null)
                throw new ArgumentNullException("schema");
            if (!Regex.Match(schema, String.Format(CultureInfo.InvariantCulture, "^{0}(,{0})*$", _validPostgresIdentifier)).Success)
                throw new ArgumentException("Schema contained invalid characters", "schema");

            Schema = schema;

			_switchSchemaSql = String.Format(CultureInfo.InvariantCulture, "SET SCHEMA '{0}'", Schema);
        }