From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | David Rowley <dgrowleyml(at)gmail(dot)com> |
Cc: | Richard Guo <guofenglinux(at)gmail(dot)com>, Alexander Lakhin <exclusion(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Properly pathify the union planner |
Date: | 2024-03-28 19:53:39 |
Message-ID: | 3704835.1711655619@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
I wrote:
> David Rowley <dgrowleyml(at)gmail(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2024-03-28 20:24:05 | Re: Possibility to disable `ALTER SYSTEM` |
Previous Message | Melih Mutlu | 2024-03-28 19:47:24 | Re: Flushing large data immediately in pqcomm |