pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert B. Easter <reaster@comptechnews.com>
To: pgsql-sql@postgresql.org
Subject: ALTER TABLE ADD COLUMN syntax question.
Date: Wed, 5 Jul 2000 23:51:04 -0400
Message-ID: <00070523563709.01354@comptechnews> (raw)


I used the command below to alter a table and it took with no problem, but the
REFERENCES appears to have been ignored since I can put invalid numbers into
last_post_id.  Are there plans to add the ability to specify column
constrainsts with ALTER TABLE ADD COLUMN in the future?  For now, I suppose I
can use ALTER TABLE ADD CONSTRAINT to make a table constraint for last_post_id.
 I hope it will not make things too slow.  Are table constraints slower than
column constraints? 

ALTER TABLE topic ADD COLUMN last_post_id INTEGER REFERENCES post ON DELETE
SET NULL;

 -- 
			Robert



Message-ID: <00070523563709.01354@comptechnews>
Permalink:  ../00070523563709.01354@comptechnews/
Also on:    postgresql.org/message-id/00070523563709.01354@comptechnews

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: reaster@comptechnews.com
  Subject: Re: ALTER TABLE ADD COLUMN syntax question.
  In-Reply-To: <00070523563709.01354@comptechnews>
  References: <00070523563709.01354@comptechnews>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox