Postgresql: Scripting psql execution with password

后端 未结 16 2522
谎友^
谎友^ 2020-11-28 18:54

How can I call psql so that it doesn\'t prompt for a password?

This is what I have:

psql -Umyuser < myscript.sql         


        
16条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-28 19:02

    8 years later...

    On my mac, I had to put a line into the file ~/.pgpass like:

    ::::
    

    Also see:
    https://www.postgresql.org/docs/current/libpq-pgpass.html
    https://wiki.postgresql.org/wiki/Pgpass

提交回复
热议问题