pgadmin4 icon indicating copy to clipboard operation
pgadmin4 copied to clipboard

Add JSON format support for "Export data" operation

Open 62mkv opened this issue 2 years ago • 4 comments

Describe the solution you'd like

In the "Import/Export data" operation for a table, there're 3 formats available: binary, csv, and text. (I am using v.6.17 but searching thru issues I could not find anything relevant either, so please close a Duplicate if already implemented in later version)

I would like to have "json" option available too

Describe alternatives you've considered

I guess, there're tools out there converting csv to JSON; should not be too difficult

Additional context

I'm used to export data as JSON in some SQL clients, like dBeaver or IntelliJ DataGrip; unfortunately, for some DBs I can not use those and can only use pgAdmin; so it would be great to have this feature here as well

62mkv avatar Aug 14 '23 08:08 62mkv

btw, on alternatives: https://github.com/jqlang/jq/wiki/Cookbook#convert-a-csv-file-with-headers-to-json

62mkv avatar Aug 14 '23 08:08 62mkv

by the way, I could not find a way to download the exported data file from the WebUI... is there one? Looks like I have to have access to FS on the server to access those files

62mkv avatar Aug 14 '23 13:08 62mkv

Currently, PostgreSQL doesn’t support this, pgAdmin needs to implement on its own

nikhil-mohite avatar Aug 25 '23 12:08 nikhil-mohite

Import/Export Data is essentially a wrapper around the psql \copy command. Therefore JSON support would have to be added there first.

dpage avatar Sep 18 '23 15:09 dpage