pythondatabasepostgresqlstdinpsql

"stdin is not a tty" when populating Postgres database


I get the message stdin is not a tty when I run the command below in my terminal.

psql -U postgres kdc < kdc.psql

kdc is the database and kdc.psql is the psql file with commands to populate the database. I am in the directory that holds the psql file.


Solution

  • I am not sure what causes that message (it does not happen here), but you should be able to avoid it using the -f option:

    psql -U postgres -d kdc -f kdc.psql