Skip to main content

I want to run bunch of postgreSQL SQL's through a file using psql command.

To check whether psql works in SQLExecutor, I tried putting below statement SQL executor.

psql -c 'SELECT * FROM testdb.test';

 

However, I got below error.

psql -c 'SELECT * FROM testdb.test';'): 'ERROR: syntax error at or near "psql"

LINE 3: psql -c 'SELECT * FROM testdb.test;

^

'

A fatal error has occurred. Check the logfile above for details

 

Can you please help.

If it's really a psql script you should use the SystemCaller and call the psql command line tool there.

If the script contains regular SQL you can copy/paste the query itself into the SQLExecutor:

select * from testdb.test

Note that it does not include the semi-colon at the end.

 


If it reads from a table another option would be using the FeatureReader transformer.

You can point that transformer to the table or use the SQL statement to get the records.


Reply