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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Alter table x add constraing



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






Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group