Re: [ADMIN] multiple sql results to shell - Mailing list pgsql-admin

From Geoff Winkless
Subject Re: [ADMIN] multiple sql results to shell
Date
Msg-id CAEzk6ffJ+Br0tRcL2e+VhPUfdicR2wObh8S=tdwJ1+o7+Sof=g@mail.gmail.com
Whole thread Raw
List pgsql-admin
On 23 October 2017 at 23:14, Randy Strauss <rstr@stanford.edu> wrote:
> To get input from a file w/o a sub-shell,
> you can put the input at the end of the loop:

That's a good point: and it also jogged my memory that in bash you can
do process substitution, so

while read a; do $a; done < <(psql -tqAX -c 'SELECT ...')

will keep the read loop in the main process, not the child (unlike the
"| while read" syntax)

Geoff


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

pgsql-admin by date:

Previous
From: Geoff Winkless
Date:
Subject: Re: [ADMIN] Processing very large TEXT columns (300MB+) using C/libpq
Next
From: Bear Giles
Date:
Subject: Re: [ADMIN] Processing very large TEXT columns (300MB+) using C/libpq