I wrote the shell script to be run over the PostgreSQL to create tables in a particular database schema. For users, db and schema creation I am using PostgrSQL Ansible modules but for tables creation I am using the shell module which runs a shell script and creates the tables.
For normal user to create this, I have used setting trust in pg_hba.conf using pg_ident.conf file, but this would be a security override for a normal DB user.
Would anybody suggest how can I use password to run this script over the database? P.S.: I even tried using PGPASSWORD, but it is not being picked up to run this shell script which in turn runs SQL file which has calls to multiple different SQL files.
Thanks in advance.