From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | MT <m_tessier(at)sympatico(dot)ca> |
Cc: | GENERAL <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: adding fields to a table |
Date: | 2003-06-27 00:30:03 |
Message-ID: | 20030627003003.GC15876@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
ALTER TABLE ADD COLUMN
On Thu, Jun 26, 2003 at 12:42:18PM -0400, MT wrote:
> Hello,
>
> I have a table with a bunch of records already inserted. When I want to add or remove fields from the, what I've done is produce an sql file, add the fields to the create table directive, and add the fields manually to each record to be inserted. Then I do an
>
> \i db_name
>
> which destroys all the tables and records and then recreates them. I'm wondering if there's a better way. Namely, I alter the table using psql, which I know can be done. What I'm not sure about is whether altering the table will also alter the records, or will the records inserted previous to the alter table be out of sync with the table.
>
> Thanks for your advice.
>
> Mark
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> "the West won the world not by the superiority of its ideas or values or
> religion but rather by its superiority in applying organized violence.
> Westerners often forget this fact, non-Westerners never do."
> - Samuel P. Huntington
From | Date | Subject | |
---|---|---|---|
Next Message | Milet Maricuelo | 2003-06-27 00:49:27 | column to row |
Previous Message | Roderick A. Anderson | 2003-06-26 23:59:47 | Re: 7.3.3 RPM build |