Re: syntax question - Mailing list pgsql-general

From Marc Millas
Subject Re: syntax question
Date
Msg-id CADX_1aax3Z5A3TKuVqBcJiJWYZCUG13OOd40KzY7wA1D9TOzmQ@mail.gmail.com
Whole thread Raw
In response to Re: syntax question  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
I take note of this.
thanks

Marc MILLAS
Senior Architect
+33607850334



On Thu, Jun 3, 2021 at 10:23 PM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Thu, Jun 3, 2021 at 1:02 PM Marc Millas <marc.millas@mokadb.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.

pgsql-general by date:

Previous
From: Marc Millas
Date:
Subject: index unique
Next
From: Paul Ramsey
Date:
Subject: Re: index unique