From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Brian Crowell <brian(at)fluggo(dot)com> |
Cc: | "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Preserving the source code of views |
Date: | 2013-10-21 04:39:23 |
Message-ID: | CAFj8pRAaHyMg3LtLYAx-4=W-SnyQMuzgfT3daEkjMLC2FkTX+A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
2013/10/21 Brian Crowell <brian(at)fluggo(dot)com>
> On Sat, Oct 19, 2013 at 11:37 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
> > For my work is very significant @a point - I wrote and I am writing
> usually
> > database centric stored procedures centric applications and @a works
> > perfect. For me a SQL code is code as any other - I use a my favourite
> > editor, I use a GIT for versioning, I can simple distributed application
> to
> > my customers.
>
> What do you do to manage dependencies among the objects? How do you
> have your scripts set up to handle deploying, say, an extra column to
> an existing view?
>
I write a delta scripts - that ensure moving database structure to expected
state. Now, you can use a infrastructure in PostgreSQL related to CREATE
EXTENSION that is able to manage these delta scripts. But I wrote own
(simple) three years ago. When you manage these scripts (together with
regress tests) continuously, then it works - and delta scripts are a good
self documentation again - there is usually different delta than GIT
repository. I'll do more often commits in GIT than I delivery features to
customer.
>
> Our databases tended to be SP-heavy before I came along. I'm big on
> views because that allows my client code to do very specific queries
> without having to write new SPs all the time.
>
There is little bit different approach in PG than MSSQL. Some times is
recommended to write procedures for all in MSSQL. PG is similar to Oracle.
Procedures (functions) are written only for processes that changes data (or
for triggers). For queries use a views mainly. Only when views cannot be
used from some reasons (more complex security, some auditing) use a table
functions.
Regards
Pavel
>
> --Brian
>
From | Date | Subject | |
---|---|---|---|
Next Message | dinesh kumar | 2013-10-21 05:49:51 | Re: when do I analyze after concurrent index creation? |
Previous Message | Brian Crowell | 2013-10-21 02:45:16 | Re: Preserving the source code of views |