Re: [SQL] how to change the type

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "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-07 02:09:59
Message-ID: GNELIHDDFBOCMGBFGEFOEEKNCAAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

OK, I'm kind of interested now in how the variable length attributes are
actually stored on disk, that you are able to increase them, but not
decrease?

I would have thought the other way around?

Chris

> -----Original Message-----
> From: Stephan Szabo [mailto:sszabo(at)megazone23(dot)bigpanda(dot)com]
> Sent: Friday, 7 December 2001 10:05 AM
> To: Christopher Kings-Lynne
> Cc: tinar; pgsql-sql(at)postgresql(dot)org
> Subject: RE: [SQL] how to chane the type
>
>
>
> On Fri, 7 Dec 2001, Christopher Kings-Lynne wrote:
>
> > What's the essential problem with changing column types in
> postgres? Is it
> > similar to the DROP COLUMN problem?
> >
> > If the answer is that the table format only has allocated
> enough space per
> > row for the existing type, then how is it possible that
> Stephen's hack below
> > will not break things?
>
> The hack below only works to change the max length of variable length
> attributes and only upward. I'd be very wary of trying to change the real
> type of a value except between ones that are bitwise compatible (like I
> think varchar and text are technically, but I'm not sure).
>
> > > The best way is to recreate the table and rename
> > > them around. If you *REALLY* don't want to do
> > > that and have a recent backup (yes, I'm serious),
> > > you can muck with pg_attribute and change
> > > atttypmod for the attribute in question
> > > (from 14 to 34).
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2001-12-07 02:41:09 Re: [SQL] how to change the type
Previous Message Stephan Szabo 2001-12-07 02:05:14 Re: how to chane the type

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2001-12-07 02:41:09 Re: [SQL] how to change the type
Previous Message Stephan Szabo 2001-12-07 02:05:14 Re: how to chane the type