Re: Postgresql - Inline comment in VIEW Sql definition

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Postgresql - Inline comment in VIEW Sql definition
Дата
Msg-id CAHyXU0z63xdE=ufdD0kTkjQZLp8aUhed0N-ShruUD8SdL31vQw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Postgresql - Inline comment in VIEW Sql definition  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
On Mon, Apr 4, 2016 at 9:10 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> vikram singh chandel <vikramschandel@outlook.com> writes:
>> PostgreSQL does not allow to strore inline comments in view's SQL definition, because the CREATE VIEW statement is
parsed,and then analyzed to see what table and other database objects are referenced, and then the analyzed parse-tree
issaved. 
>
>> However in our application we have designed one process which uses the tags that we mention within comments as part
ofCREATE VIEW definition. Things were going on good in Oracle database as it stored inline comments also. During
migrationwe are unable to port one of our functionality which have dependency on comments in View in Postgres it didn't
savethe comments. 
>
>> Do we have anyway to get the actual VIEW text in Postgres db.
>
> No.  You might be able to achieve something more or less equivalent
> using COMMENT ON to attach comments to the view's columns.

You can also wrap view creation in a function -- functions preserve
inline comments.

Generally though with postgres you want to write all DDL into scripts
rather than let the database manage the code.

merlin


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Postgresql - Inline comment in VIEW Sql definition
Следующее
От: Kevin Grittner
Дата:
Сообщение: Re: unrecognized configuration parameter "autocommit"