PostgreSQL: WHERE ID IN file_with_ids
As a_horse_with_no_name's suggestion, the first step you need a CSV file that stores ids. Then, import it to database and execute your query as below

CREATE TEMP TABLE tmp_list_ids (id int);
COPY tmp_list_ids FROM 'your absolute path here' CSV; 
SELECT * FROM your_table WHERE id IN (SELECT t.id FROM tmp_list_ids);


Please note that the COPY command is only allowed to superuser (bold is mine)


  Files named in a COPY command are read or written directly by the
  server, not by the client application. Therefore, they must reside on
  or be accessible to the database server machine, not the client. They
  must be accessible to and readable or writable by the PostgreSQL user
  (the user ID the server runs as), not the client ...
  COPY naming a file or command is only allowed to database superusers
  or users who are granted one of the default roles
  pg_read_server_files, pg_write_server_files, or
  pg_execute_server_program, since it allows reading or writing any file
  or running a program that the server has privileges to access.