* Joel Jacobson wrote:

The example from Tom Lane below results in a database which is not
possible to correctly dump using pg_dump.

The view v1 strangely becomes a table in the dump output?!

This is no bug, it's a feature (tm).

pg_dump is clever enough to detect the circular dependency and break it open by creating v1 in two steps.

A view in PostgreSQL is simply an empty table with an ON SELECT DO INSTEAD rule named "_RETURN" on it. pg_dump first creates the empty table, then view v2 depending on that table, and finally the _RETURN rule turning v1 into a view and reintroducing the circular dependency.

--
Christian

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to