ADD COLUMN damage control

From: Diana Nemirovsky <diana(at)marinconsulting(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: ADD COLUMN damage control
Date: 2005-07-18 06:44:46
Message-ID: 6.0.1.1.2.20050717233854.032f62c0@marinconsulting.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I have a about 20 or 30 tables in a database. All was working fine, my
queries, my PHP front end. Then I did two things. First, I added columns
onto each table as follows. I am showing the commands for just one table,
but it was the same code for each table.

ALTER TABLE person ADD COLUMN record_created TIMESTAMP;
ALTER TABLE person ADD COLUMN record_created_by_user INT2;
ALTER TABLE person ADD COLUMN record_modified TIMESTAMP;
ALTER TABLE person ADD COLUMN record_modified_by_user INT2;

As you can see, there are no constraints or anything. Second, I added a
trigger on the person table.

Then site-wide, things all broke. I deleted (cascade) the trigger, but what
was breaking was across all tables, and not just on the tables touched by
my trigger. Queries that used to work fine no longer do. Not having any
other logical explanation, I looked up the VACUUM command, and tried that
on each table. Same result. Things are broken all over the place. Is there
something I need to do after adding columns to my tables? Or some other
thing that could explain what has happened? I'm at a loss.

Thanks for any help or pointers.

Diana Nemirovsky
Marin Consulting, Inc.
770 Menlo Ave, Ste 223
Menlo Park, CA 94025
v (650) 617-8699
f (650) 833-0790
http://www.marinconsulting.com

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Reinhard Hnat 2005-07-18 09:49:30 Problem with starting Postgres
Previous Message Michael Fuhr 2005-07-17 09:22:17 Re: rowtypes and functions