Bug #570: \d in psql does not show triggers - Mailing list pgsql-bugs

From pgsql-bugs@postgresql.org
Subject Bug #570: \d in psql does not show triggers
Date
Msg-id 200202011341.g11Df5s66150@postgresql.org
Whole thread Raw
Responses Re: Bug #570: \d in psql does not show triggers  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Gerald Vogt (gv_de@yahoo.de) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
\d in psql does not show triggers

Long Description
When using \d in psql to find details of a table, occasionally
triggers will not be listed although the table does have triggers. This happens when the table does not have any rules.

e.g.:

SELECT relhasindex, relkind, relchecks, reltriggers, relhasrules from pg_class where relname='pub_liste';
 relhasindex | relkind | relchecks | reltriggers | relhasrules
-------------+---------+-----------+-------------+-------------
 t           | r       |         0 |          25 | f
(1 row)

However:

\d pub_liste
              Table "pub_liste"
 Attribute |         Type          | Modifier
-----------+-----------------------+----------
...
Index: pub_liste_pkey

This is due to a bug in bin/psql/describe.c line 793
< if (!error && tableinfo.hasrules)
should probably be
> if (!error && tableinfo.triggers)

Gerald

Sample Code


No file was uploaded with this report

pgsql-bugs by date:

Previous
From: Stefano Reksten
Date:
Subject: Re: New to Postgresql - Backend timeout /JDBC
Next
From: Tom Lane
Date:
Subject: Re: Bug #570: \d in psql does not show triggers