Alter table x add constraing

From: "Thomas Keller" <kellert(at)ohsu(dot)edu>
To: "Postgresql PDX_Users" <pdxpug(at)postgresql(dot)org>
Subject: Alter table x add constraing
Date: 2008-09-26 22:04:32
Message-ID: F365A756-89A1-4609-8868-6691D096EA07@ohsu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pdxpug

Hi,
I have a table that inherits most of it's columns. Is this the best,
or at least a good, way to add a constraint? Is there a more
convenient (less typing) way?

--sql snippet------
--
-- Name: pi_contact; Type: TABLE; Schema: admin; Owner: kellert;
Tablespace:
--

CREATE TABLE pi_contact (
department VARCHAR(64),
organization VARCHAR(64),
)
INHERITS (contact);

ALTER TABLE admin.pi_contact ADD PRIMARY KEY
(admin.pi_contact.contact_id);
--
-- Name: TABLE pi_contact; Type: COMMENT; Schema: admin; Owner: kellert
--

COMMENT ON TABLE pi_contact IS 'contains PI contact info, inherits
from admin.contact';

-- end ----------------------

thanks,
Tom

Tom Keller, Ph.D.
kellert(at)ohsu(dot)edu
503-494-2442
6339b RJH (BSc)
http://www.ohsu.edu/research/core

Responses

Browse pdxpug by date

  From Date Subject
Next Message Webb Sprague 2008-09-26 23:11:12 Re: Alter table x add constraing
Previous Message Selena Deckelmann 2008-09-22 16:21:38 Fwd: [ANNOUNCE] PostgreSQL 8.3.4, 8.2.10, etc. Update Release