Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group