Re: Preserving the source code of views

From: Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>
To: Brian Crowell <brian(at)fluggo(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Preserving the source code of views
Date: 2013-10-20 04:10:04
Message-ID: 5263579C.7050401@archidevsys.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 20/10/13 16:38, Brian Crowell wrote:
> Hello! I'm evaluating PostgreSQL as a replacement for SQL Server in
> our in-house systems. I've been really impressed with it so far, and
> I'm eager to try it with our data sets.
>
> 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?
>
> --Brian
The 'Real Experts' may well have more practically elegant solutions, but
a couple possibilities I can think of are as follows:

1. You have access to the source of PostgreSQL, so you could modify the
source code to preserve the source code of the views.

2. This might be able to be done using the extension mechanism, but I
have not looked into that myself.

So yes, you can do what you want, but not necessarily as easily as you
would like.

Cheers,
Gavin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2013-10-20 04:37:59 Re: Preserving the source code of views
Previous Message Brian Crowell 2013-10-20 03:38:28 Preserving the source code of views