primary key display in psql

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: primary key display in psql
Date: 2010-01-13 21:33:31
Message-ID: 1263418411.30626.13.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

When you look at a table definition with psql \d, one of the arguably
most important pieces of information -- the primary key -- is hidden
somewhere below under "indexes":

Table "public.test2"
Column | Type | Modifiers
--------+---------+-----------
a | integer | not null
b | integer | not null
Indexes:
"test2_pkey" PRIMARY KEY, btree (a, b)

I think we could easily improve that by having it look something like
this instead:

Table "public.test2"
Column | Type | Modifiers
--------+---------+-----------
a | integer | PK
b | integer | PK
Indexes:
"test2_pkey" PRIMARY KEY, btree (a, b)

Since there can only be one primary key, this should be unambiguous.

I don't have time to code this up right now, but maybe someone feels
inspired. What do you think?

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-01-13 21:42:36 Re: patch to implement ECPG side tracing / tracking ...
Previous Message Joshua D. Drake 2010-01-13 21:33:14 Re: plpython3