Bug #570: \d in psql does not show triggers

Started by PostgreSQL Bugs Listabout 24 years ago2 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PostgreSQL Bugs List (#1)
Re: Bug #570: \d in psql does not show triggers

pgsql-bugs@postgresql.org writes:

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

if (!error && tableinfo.triggers)

Looks like this is already fixed in 7.2 sources. But thanks for the
report!

regards, tom lane