Re: How to keep format of views source code as entered?

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: "Markhof, Ingolf" <ingolf(dot)markhof(at)de(dot)verizon(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, raf <raf(at)raf(dot)org>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: How to keep format of views source code as entered?
Date: 2021-01-08 16:15:16
Message-ID: 3347dc64-853f-ea7f-6256-06967248bf05@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 1/8/21 12:38 AM, Markhof, Ingolf wrote:
> Thanks for your comments and thoughts.
>
> I am really surprised that PostgreSQL is unable to keep the source text
> of a view. Honestly, for me the looks like an implementation gap.
> Consider software development. You are writing code in C++ maybe on a
> UNIX host. And whenever you feed you source code into the compiler, it
> will delete it, keeping the resulting executable, only. And you could
> not even store your source code on the UNIX system. Instead, you'd be
> forced to do so in a separate system, like GitHub. Stupid, isn't it?
> Right. There are good reasons to store the source code on GitHub or
> alike anyhow. Especially when working on larger project and when
> collaborating with many people. But in case of rather small project with
> a few people only, this might be an overkill.

The projects I work on are my own personal ones and I find an
independent version control solution the way to go for the following
reasons:

1) It is easy.
a) mkdir project_src
b) cd project_src
c) git init
Now you are set.

2) Even my simple projects generally have multiple layers.
a) Database
b) Middleware
c) UI
And also multiple languages. It makes sense to me to keep all
that information in one repo then having each layer operate independently.

3) It allows me to work on test and production code without stepping on
each other.

4) It serves as an aid to memory. Answers the question; What was I
thinking when I did that? More important it helps anyone else that might
have to deal with the code.

FYI, the program I use to manage database changes is
Sqitch(https://sqitch.org/).

>
> It shouldn't be rocket science to enable PostgreSQL to store the
> original source code as well. It's weird PostgreSQL is not doing it.
>
> Regards,
>
> Ingolf
>
>
> *Verizon Deutschland GmbH* - Sebrathweg 20, 44149 Dortmund, Germany -
> Amtsgericht Dortmund, HRB 14952 - Geschäftsführer: Detlef Eppig -
> Vorsitzender des Aufsichtsrats: Francesco de Maio
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2021-01-08 16:38:10 Re: Suggestion: provide a "TRUNCATE PARTITION" command
Previous Message Michael Lewis 2021-01-08 15:52:36 Re: Autovacuum not functioning for large tables but it is working for few other small tables.