Re: Preserving the source code of views

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Preserving the source code of views
Дата
Msg-id 495.1382304293@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Preserving the source code of views  (Brian Crowell <brian@fluggo.com>)
Ответы Re: Preserving the source code of views  (Brian Crowell <brian@fluggo.com>)
Список pgsql-general
Brian Crowell <brian@fluggo.com> writes:
> I've run across one thing that would make a transfer difficult. Postgres
> doesn't preserve the source code for views, as far as I can tell. It parses
> them and then prints them its own way. We have a lot of complicated views,
> where both the formatting and the comments are significant. In fact, we
> produce some of our system documentation directly from the comments.

> Is there currently a way to preserve the original source code of a view as
> entered in the CREATE VIEW statement?

No, and it's very unlikely that there ever will be, because it's
completely against the system structure at a number of levels.  However,
there's more than one way to skin this cat.  Many people keep their DDL as
text in some external CMS, and just load it into the database again after
any change.  If you write the view as "CREATE OR REPLACE VIEW ..." in your
DDL, this is easy, at least for cases where you're not changing the set of
columns provided by the view.

            regards, tom lane


В списке pgsql-general по дате отправления:

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: [ADMIN] what's the efficient/safest way to convert database character set ?
Следующее
От: "Huang, Suya"
Дата:
Сообщение: Re: [ADMIN] what's the efficient/safest way to convert database character set ?