Thread: Re: [HACKERS] ALTER TABLE ... ADD COLUMN

Re: [HACKERS] ALTER TABLE ... ADD COLUMN

From
Alvaro Herrera
Date:
En Fri, 4 Oct 2002 18:21:06 -0400
Alvaro Herrera <alvherre@atentus.com> escribió:

> Huh, I don't know where I got the idea you were (or someone else was?)
> in the position that attislocal should be reset.  I'll clean everything
> up and submit the patch I had originally made.

All right, this is it.  This patch merely checks if child tables have
the column.  If atttypid and atttypmod are the same, the attributes'
attinhcount is incremented; else the operation is aborted.  If child
tables don't have the column, recursively add it.

attislocal is not touched in any case.

--
Alvaro Herrera (<alvherre[a]atentus.com>)
"El Maquinismo fue proscrito so pena de cosquilleo hasta la muerte"
(Ijon Tichy en Viajes, Stanislaw Lem)

Attachment

Re: [HACKERS] ALTER TABLE ... ADD COLUMN

From
Bruce Momjian
Date:
Your patch has been added to the PostgreSQL unapplied patches list at:

    http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


Alvaro Herrera wrote:
> En Fri, 4 Oct 2002 18:21:06 -0400
> Alvaro Herrera <alvherre@atentus.com> escribi?:
>
> > Huh, I don't know where I got the idea you were (or someone else was?)
> > in the position that attislocal should be reset.  I'll clean everything
> > up and submit the patch I had originally made.
>
> All right, this is it.  This patch merely checks if child tables have
> the column.  If atttypid and atttypmod are the same, the attributes'
> attinhcount is incremented; else the operation is aborted.  If child
> tables don't have the column, recursively add it.
>
> attislocal is not touched in any case.
>
> --
> Alvaro Herrera (<alvherre[a]atentus.com>)
> "El Maquinismo fue proscrito so pena de cosquilleo hasta la muerte"
> (Ijon Tichy en Viajes, Stanislaw Lem)

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: [HACKERS] ALTER TABLE ... ADD COLUMN

From
Bruce Momjian
Date:
Patch applied.  Thanks.

---------------------------------------------------------------------------


Alvaro Herrera wrote:
> En Fri, 4 Oct 2002 18:21:06 -0400
> Alvaro Herrera <alvherre@atentus.com> escribi?:
>
> > Huh, I don't know where I got the idea you were (or someone else was?)
> > in the position that attislocal should be reset.  I'll clean everything
> > up and submit the patch I had originally made.
>
> All right, this is it.  This patch merely checks if child tables have
> the column.  If atttypid and atttypmod are the same, the attributes'
> attinhcount is incremented; else the operation is aborted.  If child
> tables don't have the column, recursively add it.
>
> attislocal is not touched in any case.
>
> --
> Alvaro Herrera (<alvherre[a]atentus.com>)
> "El Maquinismo fue proscrito so pena de cosquilleo hasta la muerte"
> (Ijon Tichy en Viajes, Stanislaw Lem)

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073