Re: Is this safe to perform on PostgreSQL 8.3.7 -> Resize a column in a PostgreSQL table without changing data - Mailing list pgsql-general

From Tom Lane
Subject Re: Is this safe to perform on PostgreSQL 8.3.7 -> Resize a column in a PostgreSQL table without changing data
Date
Msg-id 24174.1322676353@sss.pgh.pa.us
Whole thread Raw
In response to Re: Is this safe to perform on PostgreSQL 8.3.7 -> Resize a column in a PostgreSQL table without changing data  (Reid Thompson <Reid.Thompson@ateb.com>)
List pgsql-general
Reid Thompson <Reid.Thompson@ateb.com> writes:
> My assumption is that converting varchar(n) to text would still force a
> re-write of the table?  i.e. currently there's no officially 'safe' way
> to convert the field type w/o incurring a table re-write.

If you do it through ALTER TABLE, yes.  Since text and varchar are the
same thing on disk, you could get away with just manually updating the
pg_attribute row for the column ... but I'd counsel practicing on a
scratch database ;-)

            regards, tom lane

pgsql-general by date:

Previous
From: Reid Thompson
Date:
Subject: Re: Is this safe to perform on PostgreSQL 8.3.7 -> Resize a column in a PostgreSQL table without changing data
Next
From: Eduardo Morras
Date:
Subject: Re: odbc_fdw