If you want to export a subset of data (rather than the entire database or table) in CSV format:
Export subset of data with PgAdmin
- Click “Execute Arbitrary SQL queries” button
- Type query that will generate the subset of data
eg. select * from users where id >= 433 and id <= 436;
- Click “Execute query, write results to file” button (save file as
temp.csv
)
Import subset of data with psql (not supported in PgAdmin yet)
copy vitals from '/temp.csv' DELIMITERS';' CSV;
The import feature will be available in PgAdmin soon.
References
A more thorough article: Importing CSV Files to PostgreSQL Databases