From 9d2fae05ef06a7eac7de15f97c45441874a3ba42 Mon Sep 17 00:00:00 2001 From: Guillem Borrell Nogueras Date: Tue, 17 Jan 2023 18:15:31 +0100 Subject: [PATCH] Update 'Copy data to postgresql' --- Copy-data-to-postgresql.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Copy-data-to-postgresql.md b/Copy-data-to-postgresql.md index 14f5eae..25f084f 100644 --- a/Copy-data-to-postgresql.md +++ b/Copy-data-to-postgresql.md @@ -43,4 +43,10 @@ You may also need to alter some columns ``` psql -U postgres -h localhost -c 'ALTER TABLE "opportunities" ALTER COLUMN "ProductName" type varchar(1024);' -``` \ No newline at end of file +``` + +`dr` can also be used to get and process data from postgres + +``` +psql -U postgres -h localhost -c 'copy (select * from opportunities limit 10) to stdout (FORMAT 'csv', HEADER)' | dr csv -i -a +```