From: | Albin Hermange <albin(dot)hermange(at)gmail(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | add a "status" column to the pg_rules system view |
Date: | 2023-02-05 18:16:04 |
Message-ID: | CAMYCt-+J1HtUxUVUQkbuqXzHakD2CMR2eH6bvrfFJWweTE8P8w@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
hi,
I noticed that the pg_rules system view (all PG versions) does not include a
"status" field (like in pg_trigger with tgenabled column)
the official view (from 15.1 sources) is :
CREATE VIEW pg_rules AS
SELECT
N.nspname AS schemaname,
C.relname AS tablename,
R.rulename AS rulename,
pg_get_ruledef(R.oid) AS definition
FROM (pg_rewrite R JOIN pg_class C ON (C.oid = R.ev_class))
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE R.rulename != '_RETURN';
i propose to add a new field "rule_enabled" to get (easilly and officially)
the rule status to all PG version
CREATE VIEW pg_rules AS
SELECT
N.nspname AS schemaname,
C.relname AS tablename,
R.rulename AS rulename,
R.ev_enabled as rule_enabled,
pg_get_ruledef(R.oid) AS definition
FROM (pg_rewrite R JOIN pg_class C ON (C.oid = R.ev_class))
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE R.rulename != '_RETURN';
What do u think about that ?
Thx
Albin
From | Date | Subject | |
---|---|---|---|
Next Message | Andrey Borodin | 2023-02-05 18:36:39 | Re: pglz compression performance, take two |
Previous Message | Laurenz Albe | 2023-02-05 17:24:03 | Re: Make EXPLAIN generate a generic plan for a parameterized query |