I used MS SQL Server 2008 R2 (MS SQL) where I could right click the query result, copy/paste it with headers to Excel for easy exploration. Now with PG Admin (PostgreSQL) I have to do export (File > Export > CSV) then bunch of Excel steps (Text To Columns).
Is there an easy way to copy/paste the query result with headers into Excel?
Select cells from the columns you want to copy (CTRL+Click), choose "Copy selected Headers" in Results grid context menu and column names will be copied to clipboard. This action creates a comma-separated list that can be pasted wherever you need.
Using the \copy command to import data to a table on a PostgreSQL DB instance. The PostgreSQL \copy command is a meta-command available from the psql interactive client tool. You can use \copy to import data into a table on your RDS for PostgreSQL DB instance.
In PgAdmin 4 simply press F8 button to export the data to excel CSV file or click on download button provided in application.
For pgAdmin 4, there is an option to "Copy with headers". It is a drop-down beside the copy button in the Query Tool menu:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With