Postgresql: Scripting psql execution with password

后端 未结 16 2531
谎友^
谎友^ 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:00

    I find, that psql show password prompt even you define PGPASSWORD variable, but you can specify -w option for psql to omit password prompt.

提交回复
热议问题