Changing column question..

From: "Williams, Travis L, NPONS" <tlw(at)att(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Changing column question..
Date: 2002-12-19 21:07:54
Message-ID: AB815D267EC31A4693CC24D234F82916032DEA8C@ACCLUST02EVS1.ugd.att.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I just want to make sure that from what I understand I can not change a column type from varchar(20) to text or anything else without dropping the table. From my reading would the easies thing to do be to create a temp table exactly identical to my current table.. copy all of the information over from one table to another.. (is there an easy SQL command to do this.. I've done from one column in table a to one column in table b.. but never the whole table). Drop my old table.. recreate it in the new format.. then copy all of my information back?

Also,
Where can you decide/change postgresql's behavior on dealing with trying to put too much information in a column with a type of varchar(20).. I want it to insert everything up to 20 chars then drop the rest.. currently it dies with an error about trying to put in to much information..

Travis

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Neil Conway 2002-12-19 21:36:54 Re: Changing column question..
Previous Message Bruce Momjian 2002-12-19 20:30:47 Re: does version have large file support