Re: Eliminating phase 3 requirement for varlen increases via ALTER COLUMN - Mailing list pgsql-patches

From Tom Lane
Subject Re: Eliminating phase 3 requirement for varlen increases via ALTER COLUMN
Date
Msg-id 24363.1161891471@sss.pgh.pa.us
Whole thread Raw
In response to Eliminating phase 3 requirement for varlen increases via ALTER COLUMN  ("Jonah H. Harris" <jonah.harris@gmail.com>)
Responses Re: Eliminating phase 3 requirement for varlen increases via ALTER COLUMN  ("Jonah H. Harris" <jonah.harris@gmail.com>)
List pgsql-patches
"Jonah H. Harris" <jonah.harris@gmail.com> writes:
> The attached patch handles the simple case where a user wants to
> increase the user-defined storage size of a variable length object,
> such as VARCHAR or NUMERIC, without having to rebuild the table.

This makes some really quite unacceptable assumptions about the meaning
and encoding of typmod; in fact I don't believe it's even correct for
NUMERIC, which uses a two-field encoding in typmod.  NUMERIC(18,2) to
NUMERIC(20,0) cannot be a work-free conversion.  Given the plans to
allow user-defined types to have their own interpretation of typmod,
you can't just blithely assume you know the semantics of a typmod change.

I'm also wondering what's the point of comparing attbyval etc when
you've already checked it's the same type OID.

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: GUC description cleanup
Next
From: "Jonah H. Harris"
Date:
Subject: Re: Eliminating phase 3 requirement for varlen increases via ALTER COLUMN