Обсуждение: Relation on longer exists error

Поиск
Список
Период
Сортировка

Relation on longer exists error

От
Francisco Reyes
Дата:
I have a script that I regularly run. Today when I ran it I got:
ERROR:  Relation "ystats" with OID 715717097 no longer exists

I did drop/recreate that table today, but what would I be getting this
error?



Re: Relation on longer exists error

От
Fran Fabrizio
Дата:
Francisco Reyes wrote:

>I have a script that I regularly run. Today when I ran it I got:
>ERROR:  Relation "ystats" with OID 715717097 no longer exists
>
>I did drop/recreate that table today, but what would I be getting this
>error?
>
You answered your own question.  You dropped the table and recreated it,
in the process it gets a new OID.  Any functions/views/etc... declared
using that table are now looking for it at it's old OID "address".  Drop
and recreate anything that was depending on that table.

-Fran


Re: Relation on longer exists error

От
Tom Lane
Дата:
Francisco Reyes <lists@natserv.com> writes:
> I have a script that I regularly run. Today when I ran it I got:
> ERROR:  Relation "ystats" with OID 715717097 no longer exists
> I did drop/recreate that table today, but what would I be getting this
> error?

I think you broke a rule or view that referenced that table.

            regards, tom lane

Re: Relation on longer exists error

От
Francisco Reyes
Дата:
On Mon, 6 May 2002, Tom Lane wrote:

> Francisco Reyes <lists@natserv.com> writes:
> > I have a script that I regularly run. Today when I ran it I got:
> > ERROR:  Relation "ystats" with OID 715717097 no longer exists
> > I did drop/recreate that table today, but what would I be getting this
> > error?
>
> I think you broke a rule or view that referenced that table.
>             regards, tom lane

It was 4 views.
I had never used views until this weekend.
I was unaware that if one drops a table one needs to recreate it's views.
Good thing that I I keep all my table/view definitions in script files.