public inbox for [email protected]  
help / color / mirror / Atom feed
From: Rob Sargent <[email protected]>
To: Marc Mamin <[email protected]>
Cc: Shaozhong SHI <[email protected]>
Cc: pgsql-sql <[email protected]>
Subject: Re: xargs psql
Date: Thu, 28 Apr 2022 06:59:58 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>



> On Apr 28, 2022, at 6:10 AM, Marc Mamin <[email protected]> wrote:
> 
> Hello , it works for me.
> I remember some difficulties with quote escaping. That's while  I'm using $$ quoting for the sql aguments.
> 
> here is how ma commands look like:
> 
> psqlexec="psql -h$pghost -p$pgport -U$pguser -d${pgdb} -1 -P  format=u -tqX";
> 
> $psqlexec -c "SELECT relname FROM pg_class WHERE ..." \
> | xargs -n 1 -P 8 -I{} bash -c "$psqlexec -c 'select * from foo(\$\${}\$\$)' > ouputdir/{}.out"
> 
> HTH,
> 
> Marc Mamin
> ________________________________________
> Von: Shaozhong SHI <[email protected]>
> Gesendet: Donnerstag, 28. April 2022 13:32:42
> An: pgsql-sql
> Betreff: xargs psql
> 
> Running lots of postgres commands in parallel | Mark's blog (markandruth.co.uk)<https://markandruth.co.uk/2016/05/26/running-lots-of-postgres-commands-in-parallel;
> 
> Has anyone made success with this?
> 
> How to put xargs command line correctly?
> 
> Regards,
> 
> David
> 
You might be better off with gnu parallel 
> 





view thread (5+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: xargs psql
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox