1

I am new to postgres and I was following a tutorial on postgres and when I type TRUNCATE TABLE students it says relation "students" does not exists although it exists but the same command works in the tutorial

screenshot

1 Answers1

1

Your table is located in the schema sample so you need to use:

truncate table sample.students;
  • Thank You it worked but in the tutorial it worked without adding sample. , Is it due to older version in the tutorial ? – Sachin Bhattarai May 10 '22 at 09:42
  • The either put the table in the `public` schema or changed the [search_path](https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PATH) –  May 10 '22 at 09:43
  • Thank you for the answer the search_path was indeed set to sample and i missed it – Sachin Bhattarai May 10 '22 at 09:49