I have a text file with primary keys. Each line contains one primary key. Now I want to select the rows based on the input file. I can not find the right option for
psql to do this. What is the canonical way for PostgreSQL to do this job?
I know I can do
psql -c 'select * from table' db | grep -f primary_keys
But this dumps the whole database. How can I avoid it?