Re: What causes a table's oid to change?
| От | Tom Lane |
|---|---|
| Тема | Re: What causes a table's oid to change? |
| Дата | |
| Msg-id | 17491.1034140252@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: What causes a table's oid to change? (Josh Berkus <josh@agliodbs.com>) |
| Ответы |
Re: What causes a table's oid to change?
|
| Список | pgsql-novice |
Josh Berkus <josh@agliodbs.com> writes:
> This is caused by dropping and re-creating the table. Whenever you drop and
> re-created a table, all views based on the table must be dropped and
> re-created as well. Someday, we'll fix this,
7.3 fixes it, if you consider a fix to be disallowing drop of a table
that has dependent views...
regression=# create table t1 (f1 int);
CREATE TABLE
regression=# create view v1 as select * from t1;
CREATE VIEW
regression=# drop table t1;
NOTICE: rule _RETURN on view v1 depends on table t1
NOTICE: view v1 depends on rule _RETURN on view v1
ERROR: Cannot drop table t1 because other objects depend on it
Use DROP ... CASCADE to drop the dependent objects too
regression=# drop table t1 cascade;
NOTICE: Drop cascades to rule _RETURN on view v1
NOTICE: Drop cascades to view v1
DROP TABLE
regression=# select * from v1;
ERROR: Relation "v1" does not exist
regards, tom lane
В списке pgsql-novice по дате отправления: