PG Doc comments form <nore...@postgresql.org> writes:
> I am looking a way to get exact view definition, for ex :
> ...
> I am fine with adding tablename before columnname but i don't want the extra
> '::text' part. Is there anyway to achieve this(like any other system table i
> can query from to get original definition)

No, Postgres only saves a "compiled" form of a view.  Storing the original
text would have its own pitfalls, eg what if you rename a table or column
mentioned in the view?  (Also, the SQL standard has some requirements that
would be difficult to meet otherwise.)

If you really want the original text, best bet is to keep your schema
creation commands in a VCS or the like, outside the database.

                        regards, tom lane


Reply via email to