Thread: ALT*R T*BL* S*T / DR*P N*T N*LL patch - 4th try

ALT*R T*BL* S*T / DR*P N*T N*LL patch - 4th try

From
"Christopher Kings-Lynne"
Date:
OK,

This is an identical patch to what I've submitted four times now and hasn't
come through...

This is a complete patch to implement changing the nullability of an
attribute.  It passes all regressions tests.  It includes its own quite
comprehensive regression test suite and documentation.  It prevents you from
modifying system tables, non-table relations, system attributes, primary
keys and columns containing NULLs.  It fully supports inheritance.  I have
made some small changes to TODO to reflect this new functionality, plus
corrected some other TODO items.

The only thing I haven't checked are my ecpg changes.  I would like someone
with more ecpg experience to check my preproc.y changes.

Please consider for 7.3!

Since I have now added two new large functions to command.c, I propose that
sometime before 7.3 beta, command.c is refactored and an alter.c created.
There is lots of common code in the Alter* functions that should be reused.

Chris

Attachment

Re: ALT*R T*BL* S*T / DR*P N*T N*LL patch - 4th try

From
Tom Lane
Date:
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> This is a complete patch to implement changing the nullability of an
> attribute.

This looks good but I'm afraid it's out of step with recent changes
for schema support.  In particular, heap_openr is now The Wrong Thing
to use for anything except access to system relations.  As of CVS tip,
all the AlterTable routines use OID parameters not name parameters
to identify the table to work on.  Could I ask you to update the patch
to match the coding style in CVS tip?

> The only thing I haven't checked are my ecpg changes.  I would like someone
> with more ecpg experience to check my preproc.y changes.

I'd suggest leaving ecpg to Michael; he seems to prefer to do those
updates himself.

> Since I have now added two new large functions to command.c, I propose that
> sometime before 7.3 beta, command.c is refactored and an alter.c created.
> There is lots of common code in the Alter* functions that should be reused.

This is definitely a good thing to do.  I think someone else (John
Gray?) had already volunteered, but I have not seen a patch go by.

            regards, tom lane

Re: ALT*R T*BL* S*T / DR*P N*T N*LL patch - 4th try

From
Christopher Kings-Lynne
Date:
> This looks good but I'm afraid it's out of step with recent changes
> for schema support.  In particular, heap_openr is now The Wrong Thing
> to use for anything except access to system relations.  As of CVS tip,
> all the AlterTable routines use OID parameters not name parameters
> to identify the table to work on.  Could I ask you to update the patch
> to match the coding style in CVS tip?

Yep - already done - I was just about to resubmit it.

> > The only thing I haven't checked are my ecpg changes.  I would like someone
> > with more ecpg experience to check my preproc.y changes.
>
> I'd suggest leaving ecpg to Michael; he seems to prefer to do those
> updates himself.

Hmmm...I'll just leave it out then i guess...

Regards,

Chris