In a continuing effort to make pg_dump produce valid SQL where possible, I
would like to move away from the 'Create Table'/'Create Rule' method of
defining views, and actually dump the 'Create View' command.
This seems quite do-able, but before I start I thought I would ask if there
were any reasons people could think of for not doing this?
The approach will be:
- when getting table info, also call pg_get_viewdef (which returns 'not a
view' for non-view relations).
- When dumping rules, ignore all 'view rules'.
- Dump the 'Create View' statement in oid order as per normal.
It would be really nice if there was a simple way of detecting view rules
that was analagous to relkind. Is there a reason why this has not been
done? Has it been done?
Maybe the code that checks the rule name to see if it is a view could be
put in the backend?
----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \| | --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/