Thread: Removing NOT NULL Contraint

Removing NOT NULL Contraint

From
Matthew
Date:
I may be missing something simple here, but I have an attribute in a
table that was created as NOT NULL.  I now need to remove this
constraint.  I don't see a proper way to do this.  I think I can update
the pg_attribute table and change attnotnull from true to false.  Is
this an acceptable solution or is there a good reason that I should not
directly edit the system tables?

Maybe I'm missing something but I didn't see another way to do it other
then creating a new table, selecting into it and dropping the old table,
which seems like a lot of work for something so simple.

Thanks,

Matt

Basic trigger question

From
Travis Bauer
Date:
I would like a trigger that does the following:

Whenever a record is updated or inserted into table A, insert a copy of
that record into table B, which is has exactly the same structure as table
A, except for an autoincrementing field which should get the next logical
value whenever a record is entered.

I'm sure this is a basic trigger problem, but I'm having trouble
figuringout the docs.

Thank in advance,

----------------------------------------------------------------
Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
----------------------------------------------------------------