Hi vivansai4,
First you need to define the Data Source and connect it for PostgreSQL.
After that you need to make use of sqoop command to import the data from database to HDFS.
like this.
sqoop import --connect 'jdbc:postgresql://aaa.bbb.ccc.ddd:5432/Toptal?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory' \
For more information on this, please refer below article.
https://www.toptal.com/database/hdfs-tutorial-data-migration-from-postgresql