Re: poll: CHECK TRIGGER?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: poll: CHECK TRIGGER?
Date: 2012-03-09 20:15:43
Message-ID: 1331324143.23681.11.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On tor, 2012-03-08 at 19:19 -0500, Robert Haas wrote:
> On Thu, Mar 8, 2012 at 4:54 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> > * It's not terribly important to me to be able to run checkers
> > separately. If I wanted to do that, I would just disable or
> > remove the checker.
>
> Does this requirement mean that you want to essentially associate a
> set of checkers with each language and then, when asked to check a
> function, run all of them serially in an undefined order?

Well, the more I think about it and look at this patch, the more I think
that this would be complete overkill and possibly quite useless for my
purposes. I can implement the entire essence of this framework (except
the plpgsql_checker itself, which is clearly useful) in 10 lines,
namely:

CREATE OR REPLACE FUNCTION pep8(src text) RETURNS text
IMMUTABLE
LANGUAGE plsh
AS $$
#!/bin/bash

pep8 --ignore=W391 <(echo "$1") 2>&1 | sed -r 's/^[^:]*://'
$$;

SELECT proname, pep8(prosrc) FROM pg_proc WHERE prolang = ANY (SELECT oid FROM pg_language WHERE lanname LIKE '%python%') ORDER BY 1;

I don't know what more one would need.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-03-09 20:19:24 Re: [v9.2] sepgsql's DROP Permission checks
Previous Message Robert Haas 2012-03-09 20:14:03 Re: Avoiding shutdown checkpoint at failover