Skip to content

Commit 4268795

Browse files
committed
Adds support for COPY TO/FROM Azure Blob Storage
Supports following Azure Blob uri forms: - `az://{container}/key` - `azure://{container}/key` - `https://{account}.blob.core.windows.net/{container}/key` **Configuration** The simplest way to configure object storage is by creating the standard [`~/.azure/config`](https://learn.microsoft.com/en-us/cli/azure/azure-cli-configuration?view=azure-cli-latest) file: ```bash $ cat ~/.azure/config [storage] account = devstoreaccount1 key = Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw== ``` Alternatively, you can use the following environment variables when starting postgres to configure the Azure Blob Storage client: - `AZURE_STORAGE_ACCOUNT`: the storage account name of the Azure Blob - `AZURE_STORAGE_KEY`: the storage key of the Azure Blob - `AZURE_STORAGE_SAS_TOKEN`: the storage SAS token for the Azure Blob - `AZURE_CONFIG_FILE`: an alternative location for the config file **Bonus** Additionally, PR supports following S3 uri forms: - `s3://{bucket}/key` - `s3a://{bucket}/key` - `https://s3.amazonaws.com/{bucket}/key` - `https://{bucket}.s3.amazonaws.com/key` Closes #50
1 parent 80e449f commit 4268795

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pgrx_tests/object_store.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ mod tests {
338338
);
339339

340340
let copy_to_command = format!(
341-
"COPY (SELECT i FROM generate_series(1,10) i) TO '{}' WITH (format parquet);;",
341+
"COPY (SELECT i FROM generate_series(1,10) i) TO '{}' WITH (format parquet);",
342342
azure_blob_uri
343343
);
344344
Spi::run(copy_to_command.as_str()).unwrap();
@@ -365,7 +365,7 @@ mod tests {
365365
);
366366

367367
let copy_to_command = format!(
368-
"COPY (SELECT i FROM generate_series(1,10) i) TO '{}' WITH (format parquet);;",
368+
"COPY (SELECT i FROM generate_series(1,10) i) TO '{}' WITH (format parquet);",
369369
azure_blob_uri
370370
);
371371
Spi::run(copy_to_command.as_str()).unwrap();

0 commit comments

Comments
 (0)