Re: CONSTRAINT syntax in ALTER TABLE

From: "Jim Nasby" <jnasby(at)pervasive(dot)com>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: <pgsql-docs(at)postgresql(dot)org>
Subject: Re: CONSTRAINT syntax in ALTER TABLE
Date: 2006-01-04 18:07:53
Message-ID: D1D2D51E3BE3FC4E98598248901F759402C8907D@ausmail2k4.aus.pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

> From: Bruce Momjian [mailto:pgman(at)candle(dot)pha(dot)pa(dot)us]
> > is (I assume) it would do nothing to help \h ALTER TABLE in
> psql. Maybe
> > a good compromise would be to include the table_constraint
> section of
> > the CREATE TABLE syntax in the ALTER TABLE syntax.
>
> If they created the table, they have already seen the
> constraint syntax.
> I see no reason to repeat it.

The reason I'd repeat it is because when you're going to modify
existing constraints, you'll be using ALTER TABLE. Sure, if the
user memorized the constraint syntax when they created the table,
they won't need extra help. Personally, I usually make use of
column-level constraints when writing DDL, so any time I need to
use table-level syntax I often have to look something up. That's
why I'd like to see the info in \h.

If you look at our docs from a newbie standpoint, they're not very
easy to use, because it's difficult to find stuff unless you know
where to look. If you're looking in the SQL Syntax section, ALTER
TABLE is the obvious choice if you need to change something about
the table, but it's a PITA to have to refer to other documentation
to find the full syntax for the command.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

Browse pgsql-docs by date

  From Date Subject
Next Message Jim C. Nasby 2006-01-05 21:36:45 Summary table trigger example race condition
Previous Message Tom Lane 2006-01-04 16:16:15 Re: mark wath catalogs are shared - was:(Re: [NOVICE] which database to login to to create global users?)