No such file or directory - postgres sql

Hi,
I am doing lab for Week 4 - Intro to Data Engineering.
I logged into postgres database successfully and when I run step 2.10 from instructions I get an error “No such file or directory” as seen below. I am not sure why it’s not able to find the file.


postgres=> \c postgres;
Password:
psql (15.10 (Ubuntu 15.10-1.pgdg22.04+1), server 17.2)
WARNING: psql major version 15, server major version 17.
Some psql features might not work.
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)
You are now connected to database “postgres” as user “postgres”.
postgres=> \i ‘../sql/embeddings.sql’
../sql/embeddings.sql: No such file or directory


Thanks for your help

Hello @Roopa_Murthy
Have you by any chance changed your working directory in the terminal before logging in to postgres? Please, check that the file under the address ../sql/embeddings.sql exists when you run the command. Your terminal instance may had crashed before getting to this step, then the sql file will be in sql/embeddings.sql, not ../sql/embeddings.sql. You can check the existence of the file by running cat ../sql/embeddings.sql before step 2.8.

Thank you. Also, since I worked on this lab yesterday do I need to initialize terraform and aws resources again to continue?

Yes, you need to start over.

1 Like