Thread: pgsql/src backend/catalog/dependency.c backend ...

pgsql/src backend/catalog/dependency.c backend ...

From
tgl@postgresql.org (Tom Lane)
Date:
CVSROOT:    /cvsroot
Module name:    pgsql
Changes by:    tgl@postgresql.org    02/07/15 12:33:32

Modified files:
    src/backend/catalog: dependency.c heap.c indexing.c
    src/backend/commands: tablecmds.c
    src/include/catalog: catversion.h heap.h indexing.h pg_attrdef.h

Log message:
    Use the dependency mechanism to manage column defaults.  We need this
    so that dependencies in default expressions (on operators, functions,
    etc) can be expressed properly.


Re: pgsql/src backend/catalog/dependency.c backend ...

From
"Christopher Kings-Lynne"
Date:
Does this mean I no longer have to worry about removing the column default
when dropping a column?

Chris

> Modified files:
>     src/backend/catalog: dependency.c heap.c indexing.c
>     src/backend/commands: tablecmds.c
>     src/include/catalog: catversion.h heap.h indexing.h pg_attrdef.h
>
> Log message:
>     Use the dependency mechanism to manage column defaults.  We
> need this
>     so that dependencies in default expressions (on operators,
> functions,
>     etc) can be expressed properly.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>


Re: pgsql/src backend/catalog/dependency.c backend ...

From
Tom Lane
Date:
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> Does this mean I no longer have to worry about removing the column default
> when dropping a column?

It'll happen for free if you do the DROP properly, ie, through
performDeletion.  Fairly shortly, constraints, indexes, and so forth
that depend on the column will also go away automatically.

            regards, tom lane

Re: pgsql/src backend/catalog/dependency.c backend ...

From
"Christopher Kings-Lynne"
Date:
I presume I still have to manually set atthasdef to false tho, right?

Chris

> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: Tuesday, 16 July 2002 12:05 PM
> To: Christopher Kings-Lynne
> Cc: pgsql-committers@postgresql.org
> Subject: Re: [COMMITTERS] pgsql/src backend/catalog/dependency.c backend
> ...
>
>
> "Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> > Does this mean I no longer have to worry about removing the
> column default
> > when dropping a column?
>
> It'll happen for free if you do the DROP properly, ie, through
> performDeletion.  Fairly shortly, constraints, indexes, and so forth
> that depend on the column will also go away automatically.
>
>             regards, tom lane
>


Re: pgsql/src backend/catalog/dependency.c backend ...

From
Tom Lane
Date:
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> I presume I still have to manually set atthasdef to false tho, right?

No, that's part of the DROP DEFAULT behavior....

            regards, tom lane