| От | Tom Lane |
|---|---|
| Тема | Re: "Relation x does not exist" error when x does exist |
| Дата | |
| Msg-id | 27705.1002910336@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | "Relation x does not exist" error when x does exist (Gaurav Priyolkar <gaurav_lists@yahoo.com>) |
| Список | pgsql-general |
Gaurav Priyolkar <gaurav_lists@yahoo.com> writes:
> So as you can see, I get a "relation does not exist" error on a
> function that is very much there.=20
It's not there at the point of the failure, though. Your observation
that foo_1 is still there is made after rolling back the drop and
recreate of foo_1.
The reason there's an issue is that plpgsql caches a query plan for the
"SELECT x FROM foo_1" query, and that plan is no good after you drop the
original version of foo_1; but we don't currently have a mechanism to
invalidate the cached plan.
Workarounds: (1) use EXECUTE to avoid caching a plan for the problem
queries; (2) instead of DROP/CREATE, consider DELETE FROM/INSERT INTO
(or perhaps TRUNCATE instead of DELETE, although TRUNCATE can't be
rolled back).
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера