Skip to content

Commit bce0b33

Browse files
authored
Merge pull request #349 from Mytherin/issue323
Fix #323: add support for PASSFILE to Postgres secrets
2 parents 0d70d1d + 6954fec commit bce0b33

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/postgres_extension.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ unique_ptr<BaseSecret> CreatePostgresSecretFunction(ClientContext &context, Crea
9292
result->secret_map["password"] = named_param.second.ToString();
9393
} else if (lower_name == "port") {
9494
result->secret_map["port"] = named_param.second.ToString();
95+
} else if (lower_name == "passfile") {
96+
result->secret_map["passfile"] = named_param.second.ToString();
9597
} else {
9698
throw InternalException("Unknown named parameter passed to CreatePostgresSecretFunction: " + lower_name);
9799
}
@@ -109,6 +111,7 @@ void SetPostgresSecretParameters(CreateSecretFunction &function) {
109111
function.named_parameters["user"] = LogicalType::VARCHAR;
110112
function.named_parameters["database"] = LogicalType::VARCHAR; // alias for dbname
111113
function.named_parameters["dbname"] = LogicalType::VARCHAR;
114+
function.named_parameters["passfile"] = LogicalType::VARCHAR;
112115
}
113116

114117
void SetPostgresNullByteReplacement(ClientContext &context, SetScope scope, Value &parameter) {

src/storage/postgres_catalog.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ string PostgresCatalog::GetConnectionString(ClientContext &context, const string
9292
new_connection_info += AddConnectionOption(kv_secret, "host");
9393
new_connection_info += AddConnectionOption(kv_secret, "port");
9494
new_connection_info += AddConnectionOption(kv_secret, "dbname");
95+
new_connection_info += AddConnectionOption(kv_secret, "passfile");
9596

9697
connection_string = new_connection_info + connection_string;
9798
} else if (explicit_secret) {

0 commit comments

Comments
 (0)