Re: Get original view definition without modification - Mailing list pgsql-docs

From Tom Lane
Subject Re: Get original view definition without modification
Date
Msg-id 10395.1590764802@sss.pgh.pa.us
Whole thread Raw
In response to Get original view definition without modification  (PG Doc comments form <noreply@postgresql.org>)
List pgsql-docs
PG Doc comments form <noreply@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



pgsql-docs by date:

Previous
From: p.luzanov@postgrespro.ru
Date:
Subject: Re: max_wal_size
Next
From: PG Doc comments form
Date:
Subject: Minor result error in binary strings documentation