meaningful trigger descriptions - Mailing list pgsql-novice

From Jason S. Friedman
Subject meaningful trigger descriptions
Date
Msg-id 20030217210647.GA21589@charles
Whole thread Raw
List pgsql-novice
When one describes a table psql lists the foreign keys after the table columns, e.g.:

calendar=> \d business
                                        Table "business"
      Column      |            Type             |                   Modifiers

------------------+-----------------------------+-----------------------------------------------
 id               | integer                     | not null default nextval('business_id'::text)
 name             | character varying(100)      | not null
 owner            | character varying(100)      | not null
 address_line_1   | character varying(100)      | not null
 address_line_2   | character varying(100)      |
 city             | character varying(100)      | not null
 state_code       | character(2)                | not null
 zip              | character(5)                | not null
 zip_4            | character(4)                |
 primary_timezone | character(3)                | not null default 'GMT'
 create_date      | timestamp(0) with time zone | default now()
 last_update_date | timestamp(0) with time zone |
 create_by        | integer                     |
 last_update_by   | integer                     |
Primary key: business_pk
Unique keys: business_name_key,
             business_name_owner
Triggers: RI_ConstraintTrigger_56403390,
          RI_ConstraintTrigger_56403392,
          RI_ConstraintTrigger_56403426,
          RI_ConstraintTrigger_56403428,
          RI_ConstraintTrigger_56403514,
....

Does anyone have a query handy that will print out something prettier for those foreign key constraints, like:

tablename   constraint
----------------------
foo         FOREIGN KEY (a) REFERENCES bar
foo         FOREIGN KEY (b) REFERENCES goo
bar        q FOREIGN KEY (z) REFERENCES goo


pgsql-novice by date:

Previous
From: douggorley@shaw.ca
Date:
Subject: Re: MySQL comparable syntax for PostgreSQL
Next
From: "Dirk Hamstra"
Date:
Subject: Re Dynamic IP - pg_hba