AenidMansarde
AenidMansarde

Reputation: 33

Postgres/PGAdmin exporting empty CSV

I've generated a large table (1.1 million rows) in Postgres/PGAdmin that I'd like to export to CSV. When I click the "Save results to file (F8)" button, I get the "Downloading Results..." spinning wheel, and then the window letting me name the CSV and save it where I want on my computer. But once that CSV is on my computer it's empty. I've tried restarting PGAdmin and my computer but it's still happening.

Does anyone know why this is happening / how to fix? I would just copy/paste the table into a text file, but I think it's too large.

I couldn't find any prior questions about this.

Thanks.

Upvotes: 2

Views: 3269

Answers (1)

Brian Lee
Brian Lee

Reputation: 31

I ran into the same problem. My solution was to create a table using your intended select statement.

Example:

CREATE TABLE query_results AS (

Select * from XXXX

)

Then, export the table to CSV.

Upvotes: 3

Related Questions