Re: How to keep format of views source code as entered? - Mailing list pgsql-general

From Christophe Pettus
Subject Re: How to keep format of views source code as entered?
Date
Msg-id 33A6B3F2-D21E-4826-9758-282D2AE1B30D@thebuild.com
Whole thread Raw
In response to RE: How to keep format of views source code as entered?  ("Markhof, Ingolf" <ingolf.markhof@de.verizon.com>)
List pgsql-general

> On Jan 9, 2021, at 06:22, Markhof, Ingolf <ingolf.markhof@de.verizon.com> wrote:
> What I would like to have is something that would automatically update the SQL code in the software repository when I
runa CREATE OR REPLACE VIEW. 

I think you are approaching this backwards.  The SQL in the repository should be the definitive version.  If you wish
tochange the view, you change the CREATE OR REPLACE VIEW command that you have stored in the repository, and then apply
thatto the database so it now has the new view definition. 

You may not, in a small independent project, feel the need for a source code repository, but it becomes very useful
veryquickly. 

--
-- Christophe Pettus
   xof@thebuild.com




pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Select a column and then apply JSONB_ARRAY_ELEMENTS to it
Next
From: Jack Orenstein
Date:
Subject: Static memory, shared memory