pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #17771: add a "status" column to the pg_rules system view
2+ messages / 2 participants
[nested] [flat]

* BUG #17771: add a "status" column to the pg_rules system view
@ 2023-02-05 16:02  PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2023-02-05 16:02 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: albin.hermange@gmail.com

The following bug has been logged on the website:

Bug reference:      17771
Logged by:          Albin Hermange
Email address:      albin.hermange@gmail.com
PostgreSQL version: 15.1
Operating system:   all OS
Description:        

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #17771: add a "status" column to the pg_rules system view
@ 2023-02-05 17:15  David G. Johnston <david.g.johnston@gmail.com>
  parent: PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: David G. Johnston @ 2023-02-05 17:15 UTC (permalink / raw)
  To: albin.hermange@gmail.com; pgsql-bugs@lists.postgresql.org

On Sun, Feb 5, 2023 at 9:51 AM PG Bug reporting form <noreply@postgresql.org>
wrote:

> The following bug has been logged on the website:
>
> Bug reference:      17771
> Logged by:          Albin Hermange
> Email address:      albin.hermange@gmail.com
> PostgreSQL version: 15.1
> Operating system:   all OS
> Description:
>
> 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 ?
>
>
Its absence isn't a bug - if you want to take a poll, post something to
pgsql-general, if you want to submit a patch, send it to pgsql-hackers.

David J.

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2023-02-05 17:15 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-02-05 16:02 BUG #17771: add a "status" column to the pg_rules system view PG Bug reporting form <noreply@postgresql.org>
2023-02-05 17:15 ` David G. Johnston <david.g.johnston@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox