Re: [SQL] how to change the type - Mailing list pgsql-hackers

From Stephan Szabo
Subject Re: [SQL] how to change the type
Date
Msg-id 20011206183802.E30420-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: [SQL] how to change the type  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Responses Re: [SQL] how to change the type  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, 7 Dec 2001, Christopher Kings-Lynne wrote:

> 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?

IIRC, the values are stored as length + data.  I think char() might
do wierd things (I don't know if the trailing spaces are stored), but
varchar() and text should be expandable because anything that could have
fit before should still fit and look the same.  Going down is
problematic, because if you have a varchar(5) field where one value is say
'abcd' and you make it varchar(3) what happens?




pgsql-hackers by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: OIDs missing in pg_attribute?
Next
From: mlw
Date:
Subject: Re: Remote connections?