Hi Group - can someone please verify my procdure to alter this table ?
I'm a bit nervous about doing this and I'd like to make sure it is
correct:
acronyms=# \d acronyms
Table "mytable"
Column | Type | Modifiers
---------+-----------------------+------------------------------------------------
id | integer | not null default
nextval('acronyms_seq'::text)
acry | character varying(40) | not null
titl | text | not null
urll | text |
expl | text |
acry_f | character varying(40) |
title_f | character varying(40) |
expl_f | character varying(40) |
Primary key: acronyms_pkey
Unique keys: acronyms_acry_key
I'd like to:
change acry and titl to NULL
change title_f and expl_f to text type
Here's what I would do:
create table tmp as select * from mytable;
drop table mytable;
create table "mytable" (
"id" integer DEFAULT nextval('mytable_seq'::text) NOT NULL,
"acry" character varying(40),
"titl" text,
"urll" text,
"expl" text,
"acry_f" character varying(40),
"title_f" text,
"expl_f" text,
Constraint "mytable_pkey" Primary Key ("id")
);
insert into mytable * from tmp;
drop table tmp;
Thanks, dave