pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Rearranging ALTER TABLE to avoid multi-operations bugs
Date: Wed, 29 May 2019 18:17:46 -0400
Message-ID: <41540.1559168266@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoYXFAg+6wYLf8+s3wOqaER6XO-TE4gMHcgoJa8iQKR3LQ@mail.gmail.com>
References: <10365.1558909428@sss.pgh.pa.us>
	<CA+Tgmoa3FzZvWriJmqquvAbf8GxrC9YM9umBb18j5M69iuq9bg@mail.gmail.com>
	<41500.1559166722@sss.pgh.pa.us>
	<CA+TgmoYXFAg+6wYLf8+s3wOqaER6XO-TE4gMHcgoJa8iQKR3LQ@mail.gmail.com>

Robert Haas <robertmhaas@gmail.com> writes:
> From my point of view, the DDL code doesn't do a great job separating
> parsing/parse analysis from optimization/execution.  The ALTER TABLE
> stuff is actually pretty good in this regard.

Meh.  I think a pretty fair characterization of the bug(s) I'm trying to
fix is "we separated parse analysis from execution when we should not
have, because it leads to parse analysis being done against the wrong
database state".  So I'm *very* suspicious of any argument that we should
try to separate them more, let alone that doing so will somehow fix this
set of bugs.

>> Also, recursive ProcessUtility cases exist independently of this issue,
>> in particular in CreateSchemaCommand.  My worry about my patch upthread
>> is not really that it introduces another one, but that it doesn't do
>> anything towards providing a uniform framework/notation for all these
>> cases.

> I'm not really sure I understand this.

Well, I tried to wrap what are currently a random set of ProcessUtility
arguments into one struct to reduce the notational burden.  But as things
are set up, that's specific to the ALTER TABLE case.  I'm feeling like it
should not be, but I'm not very sure where to draw the line between
arguments that should be folded into the struct and ones that shouldn't.

Note that I think there are live bugs in here that are directly traceable
to not having tried to fold those arguments before.  Of the four existing
recursive ProcessUtility calls with context = PROCESS_UTILITY_SUBCOMMAND,
two pass down the outer call's "ParamListInfo params", and two don't ---
how is it not a bug that they don't all behave alike?  And none of the
four pass down the outer call's QueryEnvironment, which seems like even
more of a bug.  So it feels like we ought to have a uniform approach
to what gets passed down during recursion, and enforce it by passing
all such values in a struct rather than as independent arguments.

			regards, tom lane





view thread (23+ messages)  latest in thread

Message-ID: <41540.1559168266@sss.pgh.pa.us>
Permalink:  ../41540.1559168266@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/41540.1559168266@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com
  Subject: Re: Rearranging ALTER TABLE to avoid multi-operations bugs
  In-Reply-To: <41540.1559168266@sss.pgh.pa.us>
  References: <10365.1558909428@sss.pgh.pa.us> <CA+Tgmoa3FzZvWriJmqquvAbf8GxrC9YM9umBb18j5M69iuq9bg@mail.gmail.com> <41500.1559166722@sss.pgh.pa.us> <CA+TgmoYXFAg+6wYLf8+s3wOqaER6XO-TE4gMHcgoJa8iQKR3LQ@mail.gmail.com> <41540.1559168266@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox