How to read data users.csv.gz?

Santosh Anand 0 Reputation points
2024-10-03T11:44:25.7566667+00:00

Hi, I am referring link https://video2.skills-academy.com/en-us/azure/cosmos-db/postgresql/quickstart-distribute-tables

And getting this error:

citus=> SELECT * FROM create_extension('azure_storage');

create_extension


(1 row)

citus=> COPY github_users FROM 'https://pgquickstart.blob.core.windows.net/github/users.csv.gz';

ERROR: azure_storage: failed to read from service

citus=>

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,631 questions
Azure Database for PostgreSQL
{count} votes

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2024-10-03T11:44:25.7833333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To read data from users.csv.gz, you can use the COPY command in PostgreSQL. Here's an example command to load the data into a table:

    COPY github_users
    FROM 'https://pgquickstart.blob.core.windows.net/github/users.csv.gz'
    WITH (FORMAT 'csv');
    

    This command will load the data from the specified URL into the github_users table. The FORMAT parameter specifies the file format, which in this case is CSV.

    If you're encountering an error when running the COPY command, it's possible that the azure_storage extension is not properly installed or configured. Make sure that you have followed the instructions in the context to create and configure the extension and map the storage account.


    References:

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.