Re: Properly pathify the union planner - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Properly pathify the union planner
Date
Msg-id 3704835.1711655619@sss.pgh.pa.us
Whole thread Raw
In response to Re: Properly pathify the union planner  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Properly pathify the union planner
List pgsql-hackers
I wrote:
> David Rowley <dgrowleyml@gmail.com> writes:
>> Maybe something with "Parameters" in the name?

> SubqueryParameters might be OK.  Or SubqueryPlannerExtra?
> Since this is a bespoke struct that will probably only ever
> be used with subquery_planner, naming it after that function
> seems like a good idea.

On third thought, I'm not at all convinced that we even want to
invent this struct as compared to just adding another parameter
to subquery_planner.  The problem with a struct is what happens
the next time we need to add a parameter?  If we add yet another
function parameter, we can count on the compiler to complain
about call sites that didn't get the memo.  Adding a field
within an existing struct provokes no such warning, leading
to situations with uninitialized fields that might accidentally
work during testing, but fail the minute they get to the field.

If you do want to go this direction, a minimum safety requirement
would be to have an ironclad rule that callers memset the whole
struct to zero before filling it, so that any not-set fields
will at least have predictable values.  But I don't see the
point really.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Melih Mutlu
Date:
Subject: Re: Flushing large data immediately in pqcomm
Next
From: Bruce Momjian
Date:
Subject: Re: Possibility to disable `ALTER SYSTEM`