Re: [SQL] how to change the type

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [SQL] how to change the type
Date: 2001-12-07 02:41:09
Message-ID: 20011206183802.E30420-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql


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?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2001-12-07 02:47:22 OIDs missing in pg_attribute?
Previous Message Christopher Kings-Lynne 2001-12-07 02:09:59 Re: [SQL] how to change the type

Browse pgsql-sql by date

  From Date Subject
Next Message sharmad 2001-12-07 03:46:50 Replacing "LIKE" with "="
Previous Message Christopher Kings-Lynne 2001-12-07 02:09:59 Re: [SQL] how to change the type