pgsql-server/src/bin/psql describe.c

From: momjian(at)postgresql(dot)org (Bruce Momjian - CVS)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql-server/src/bin/psql describe.c
Date: 2003-03-27 16:57:39
Message-ID: 20030327165739.CA5944758C9@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

CVSROOT: /cvsroot
Module name: pgsql-server
Changes by: momjian(at)postgresql(dot)org 03/03/27 11:57:39

Modified files:
src/bin/psql : describe.c

Log message:
New \d format:

Example:

test=# \d test
Table "public.test"
Column | Type | Modifiers
--------+---------+-----------
a | integer | not null
Indexes:
"test_pkey" PRIMARY KEY btree (a)
Check Constraints:
"$2" CHECK (a > 1)
Foreign Key Constraints:
"$1" FOREIGN KEY (a) REFERENCES parent(b)
Rules:
myrule AS ON INSERT TO test DO INSTEAD NOTHING
Triggers:
"asdf asdf" AFTER INSERT OR DELETE ON test FOR EACH STATEMENT EXECUTE
PROCEDURE update_pg_pwd_and_pg_group(),
mytrigger AFTER INSERT OR DELETE ON test FOR EACH ROW EXECUTE PROCEDURE
update_pg_pwd_and_pg_group()

I have minimised the double quoting of identifiers as much as I could
easily, and I will submit another patch when I have time to work on it that
will use a 'fmtId' function to determine it exactly.

I think it's a significant improvement in legibility...

Obviously the table example above is slightly degenerate in that not many
tables in production have heaps of (non-constraint) triggers and rules.

Christopher Kings-Lynne

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian - CVS 2003-03-27 16:58:21 pgsql-server/src/pl/plpython feature.expected ...
Previous Message Bruce Momjian - CVS 2003-03-27 16:55:11 pgsql-server/src/include/executor tstoreReceiver.h