Re: [SQL] how to change the type

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Stephan Szabo" <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: "Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [SQL] how to change the type
Date: 2001-12-10 02:32:56
Message-ID: GNELIHDDFBOCMGBFGEFOAELBCAAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

> char(N) does store the trailing spaces, so altering N would give
> unwanted results: again, existing values would read out with the old
> width until updated. You could fix this by issuing
>
> UPDATE tab SET col = col
>
> after tweaking the pg_attribute.atttypmod value. (AFAICS, any "clean"
> implementation would have to do just that internally, with the same
> unpleasant space and speed implications as we've discussed for DROP
> COLUMN.)

Can I take this opportunity to give my little thought on operations like
these (alter column type, drop column, etc.?)

If the DBA had to issue these commands every 5 minutes, then the speed and
space implications would be bad, yeah. However, if all I want to do is drop
a column once every 6 months, then I don't really care that the operation
might take a minute and might consume lots of disk space...

Chris

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 2001-12-10 04:59:07 Minor updates for date/time committed
Previous Message Christopher Kings-Lynne 2001-12-10 02:29:17 Re: pg_dump: Sorted output, referential integrity

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Lockwood 2001-12-10 08:42:58 Can anybody help me with SQL?
Previous Message Dominic Da Silva 2001-12-09 20:29:24 Poolman/mySQL transaction exception on connect