Skip to main content
1 of 3
Erwin Brandstetter
  • 182.2k
  • 28
  • 457
  • 620

Either run the script as system user postgres - who has a corresponding db user with peer authentication set up, according to your pg_hba.conf file. Like @Milen already hinted in his comment. Or set up password-less access for your system user, preferably with a .pgpass file.

More details in this closely related answer:
PostgreSQL Scheduled Database Backup.

Or this comprehensive answer about password-less access on SO.

Erwin Brandstetter
  • 182.2k
  • 28
  • 457
  • 620