Re: using index or check in ALTER TABLE SET NOT NULL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: using index or check in ALTER TABLE SET NOT NULL
Date
Msg-id 9878.1511970441@sss.pgh.pa.us
Whole thread Raw
In response to Re: using index or check in ALTER TABLE SET NOT NULL  (Stephen Frost <sfrost@snowman.net>)
Responses Re: using index or check in ALTER TABLE SET NOT NULL  (Sergei Kornilov <sk@zsrv.org>)
Re: using index or check in ALTER TABLE SET NOT NULL  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
Stephen Frost <sfrost@snowman.net> writes:
> Isn't the first concern addressed by using SPI..?

I did not look at the patch yet, but TBH if it uses SPI for sub-operations
of ALTER TABLE I think that is sufficient reason to reject it out of hand.
Doing things that way would create way too much of a vulnerability surface
for code touching a partially-updated table.  At minimum, we'd have to
blow holes in existing protections like CheckTableNotInUse, and I think
we'd be forever finding other stuff that failed to work quite right in
that context.  I do not want ALTER TABLE going anywhere near the planner
or executor; I'm not even happy that it uses the parser (for index
definition reconstruction).
        regards, tom lane


pgsql-hackers by date:

Previous
From: Petr Jelinek
Date:
Subject: Re: [HACKERS] Issues with logical replication
Next
From: Sergei Kornilov
Date:
Subject: Re: using index or check in ALTER TABLE SET NOT NULL