Search Postgresql Archives

multiple sql results to shell

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have this bash/sql script which outputs some curl commands.  the backticks causes it to get interpreted by the shell.   This works fine if there is one result, but when there are many rows returned, it looks like one shell command.  

any help on getting multiple rows returned to be executed by the shell would be appreciated!

thanks!

`psql -P "tuples_only=on" -h ${DB_HOST} -d ${DB_NAME} -U ${DB_USER} -c "select 'curl -X POST http://${REGISTER_HOST}:8080/' || source_id || '/${MT}/' || model || '/' || site || '/backoffice/register' from myschema.events where source_id = $SOURCE_ID and ineffective_date is null"`



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux