@@ -18,6 +18,7 @@ static unique_ptr<Catalog> PostgresAttach(StorageExtensionInfo *storage_info, Cl
1818
1919 string secret_name;
2020 string schema_to_load;
21+ PostgresIsolationLevel isolation_level = PostgresIsolationLevel::REPEATABLE_READ;
2122 for (auto &entry : info.options ) {
2223 auto lower_name = StringUtil::Lower (entry.first );
2324 if (lower_name == " type" || lower_name == " read_only" ) {
@@ -26,12 +27,27 @@ static unique_ptr<Catalog> PostgresAttach(StorageExtensionInfo *storage_info, Cl
2627 secret_name = entry.second .ToString ();
2728 } else if (lower_name == " schema" ) {
2829 schema_to_load = entry.second .ToString ();
30+ } else if (lower_name == " isolation_level" ) {
31+ auto param = entry.second .ToString ();
32+ auto lparam = StringUtil::Lower (param);
33+ if (lparam == " read committed" ) {
34+ isolation_level = PostgresIsolationLevel::READ_COMMITTED;
35+ } else if (lparam == " repeatable read" ) {
36+ isolation_level = PostgresIsolationLevel::REPEATABLE_READ;
37+ } else if (lparam == " serializable" ) {
38+ isolation_level = PostgresIsolationLevel::SERIALIZABLE;
39+ } else {
40+ throw InvalidInputException (" Invalid value \" %s\" for isolation_level, expected READ COMMITTED, "
41+ " REPEATABLE READ or SERIALIZABLE" ,
42+ param);
43+ }
2944 } else {
3045 throw BinderException (" Unrecognized option for Postgres attach: %s" , entry.first );
3146 }
3247 }
3348 auto connection_string = PostgresCatalog::GetConnectionString (context, attach_path, secret_name);
34- return make_uniq<PostgresCatalog>(db, std::move (connection_string), std::move (attach_path), access_mode, std::move (schema_to_load));
49+ return make_uniq<PostgresCatalog>(db, std::move (connection_string), std::move (attach_path), access_mode,
50+ std::move (schema_to_load), isolation_level);
3551}
3652
3753static unique_ptr<TransactionManager> PostgresCreateTransactionManager (StorageExtensionInfo *storage_info,
0 commit comments