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

Re: primary key display in psql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: primary key display in psql
Date: 2010-01-13 21:47:37
Message-ID: 4667.1263419257@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> 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)

Spelling out "primary key" would seem to be more in keeping with existing
entries in that column, eg we have "not null" not "NN".

I think this is a sensible proposal for a single-column PK, but am less
sure that it makes sense for multi-col.  The modifiers column is
intended to describe column constraints; which a multi-col PK is not,
by definition.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2010-01-13 21:49:59
Subject: per-user pg_service.conf
Previous:From: Peter EisentrautDate: 2010-01-13 21:46:26
Subject: Re: plpython3

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