I am having troubles getting started with psql. I can login using the script below
myusername@ubuntu:~/Desktop/dbscripts$ sudo su - postgres
postgres@ubuntu:~$
But, once here, I cannot figure out how to find my .sql file. I tried the options supplied by Bolo here: How to import existing *.sql files in PostgreSQL 8.4? But they only give
myusername@ubuntu:~/Desktop/dbscripts$ psql -U root -d first -f myscript.sql
psql: FATAL: Peer authentication failed for user "root"
and
myusername@ubuntu:~/Desktop/dbscripts$ psql -f myscript.sqlp
sql: FATAL: role "myusername" does not exist
and
myusername@ubuntu:~/Desktop/dbscripts$ sudo su - postgres
postgres@ubuntu:~$ \i myscript.sql
The program 'i' is currently not installed. To run 'i' please ask your administrator to install the package 'iprint'