From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Marc Millas <marc(dot)millas(at)mokadb(dot)com> |
Cc: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org> |
Subject: | Re: syntax question |
Date: | 2021-06-03 20:22:58 |
Message-ID: | CAKFQuwZJj4+A-oPkOyc7gztBpNo1SaLXYeM8ya1+dq0Fnk9BUQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Thu, Jun 3, 2021 at 1:02 PM Marc Millas <marc(dot)millas(at)mokadb(dot)com> wrote:
> about knowing if I should...
> We have to create a set of triggers (insert, update, delete) within a huge
> set of tables. and that list of tables, and structure of them can be
> customized, maintained, ...
> so we were looking for a standard script to automatize the building of the
> whole thing, taking list of columns and constraints (for PK) directly from
> pg_catalog.
> Now it works :-)
>
> but.. why do you ask that question ? is there any king of hidden wolf we
> didnt see ?
>
Having done this (building a - limited - code generator framework using
bash+psql+plpgsql) I will say that doing so using pl/pgsql, while appealing
from "no extra tooling needed" perspective, doesn't play to pl/pgsql's
strengths. Using a different language to generate SQL script files, which
can then be executed, is probably a better way to go - if you have a
different language you can build upon (i.e., not a shell scripting language
like bash).
In particular, plpgsql nested strings are not fun to work with in any
significant volume.
David J.
From | Date | Subject | |
---|---|---|---|
Next Message | Marc Millas | 2021-06-03 20:51:55 | index unique |
Previous Message | Marc Millas | 2021-06-03 20:01:44 | Re: syntax question |