0
votes

I am getting "relation does not exist" error while trying to truncate a particular table.The table actually exists in the database. Also when I click on this table in pg admin I get the warning for vacuum. Are these things related.?

------ Adding few more details---- Truncate statement is called within a greenplum function. This job truncates and load the table on a daily basis(This table is queried in reports)The issue pops up once in a while and if we go and restart the same job again after few minutes it succeeds.

1
no it is not related - Vao Tsun
It could be a search_path issue. Are you including the schema name in the drop table statement? If not, try drop table schema.table cascade; - Jon Roberts
Yea schema name is included in the truncate statement. One thing that confuses me is that after a while if I rerun the same query again, it succeeds( This is a table in production and is used by reports). - tinku_jv
Are you dropping the table ever in the process or just using truncate? - Jon Roberts
Just truncate and load. - tinku_jv

1 Answers

0
votes

Please try to do the below select * from schemaname.tablename limit 10; If you don't use the schema name then you have to set the search path as below and then run your select

set search_path=schemaname;