pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedChanging Column Type
2+ messages / 2 participants
[nested] [flat]
* Changing Column Type
@ 2002-09-09 16:49 Peter Atkins <peter.atkins@NXCD.com>
2002-09-10 19:51 ` Re: Changing Column Type Kevin Brannen <kevinb@nurseamerica.net>
0 siblings, 1 reply; 2+ messages in thread
From: Peter Atkins @ 2002-09-09 16:49 UTC (permalink / raw)
To: pgsql-sql
All,
Is there a way to easily change the type of column? Or do I have to drop
and create again.
From:
assignment_notes | character varying(255)
To:
assignment_notes | text
Thanks,
-p
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Changing Column Type
2002-09-09 16:49 Changing Column Type Peter Atkins <peter.atkins@NXCD.com>
@ 2002-09-10 19:51 ` Kevin Brannen <kevinb@nurseamerica.net>
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Brannen @ 2002-09-10 19:51 UTC (permalink / raw)
To: Peter Atkins <peter.atkins@NXCD.com>; +Cc: pgsql-sql
Peter Atkins wrote:
> All,
>
> Is there a way to easily change the type of column? Or do I have to drop
> and create again.
>
> From:
> assignment_notes | character varying(255)
>
> To:
> assignment_notes | text
Do that kind of change will require creating a new table, copying the
data, dropping the old table, renaming the new to the old.
If you were changing from varchar(20) to varchar(255), you could hack
the system tables and be OK (or so I've read). Going smaller is
possible too, as long as your 110% sure you don't have any data bigger
then the new smaller size (or you're taking your life into your own
hands so to speak. :-)
HTH,
Kevin
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2002-09-10 19:51 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-09-09 16:49 Changing Column Type Peter Atkins <peter.atkins@NXCD.com>
2002-09-10 19:51 ` Kevin Brannen <kevinb@nurseamerica.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox