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
Asked
Active
Viewed 23 times
1 Answers
1
Your table is located in the schema sample so you need to use:
truncate table sample.students;
a_horse_with_no_name
- 497,550
- 91
- 775
- 843
-
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) – a_horse_with_no_name 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