From: | "Josh Berkus" <josh(at)agliodbs(dot)com> |
---|---|
To: | john-paul delaney <jp(at)justatest(dot)com> |
Cc: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: Nu-B\Column:Alter type |
Date: | 2002-02-22 18:37:37 |
Message-ID: | web-700839@davinci.ethosmedia.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
> In your sequence below - where does the column (e.g. col 8 of 25) get
> changed?
Ooops.
Step 0.1: pg_dump -s -t bad_table > bad_table.sql
Step 0.2: Edit bad_table.sql to the table definition you want.
Step 0.3: Use the file bad_table.sql as your CREATE TABLE statement in
step 3.
> Would I list the good column names to insert into bad_table in point
> 4., then insert my new column - or is there a way to "select *
> except one" (I guess that's pretty lax SQL)?
Hmmm ... I thought that you wanted to change an existing column from
DATE to VARCHAR.
> > 1. CREATE TABLE temp1 AS
> > SELECT * FROM bad_table;
> > 2. DROP TABLE bad_table;
> > 3. CREATE TABLE bad_table;
> > 4. INSERT INTO bad_table SELECT * FROM temp1;
> > 5. DROP TABLE temp1
-Josh
______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh(at)agliodbs(dot)com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco
From | Date | Subject | |
---|---|---|---|
Next Message | Josh Berkus | 2002-02-22 19:33:58 | Re: One big table or several smaller tables ? |
Previous Message | john-paul delaney | 2002-02-22 18:17:26 | Nu-B\Column:Alter type |