From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | YUriy Zhuravlev <u(dot)zhuravlev(at)postgrespro(dot)ru>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: clearing opfuncid vs. parallel query |
Date: | 2015-10-22 21:09:08 |
Message-ID: | 51139.1445548148@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Thu, Oct 22, 2015 at 4:32 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I'm not sure that you could get to a point where you were
>> generating this stuff from anything that wasn't in essence an arcane
>> representation of the .c files. It might be slightly harder to make
>> errors of omission that way, but I'm suspicious that that would come at
>> the cost of a net loss of readability.
> That is possible, but the current situation isn't good either.
> Despite everybody's best efforts, we mess this up more than is really
> desirable. Commit b8fe12a83622b350dc6849f8bb933bd8a86c1424 fixed bugs
> in a whole bunch of preceding commits, and I wonder if anybody else
> would have found those if Noah hadn't. It's just too easy to miss
> these things today. If generating the .c files isn't practical,
> another alternative worth exploring would be a tool to cross-check
> them against the .h files.
Yeah, I could get on board with that. It doesn't seem terribly hard:
just make sure that all fields mentioned in the struct declaration are
mentioned in each relevant routine. (Cases where we intentionally skip
a field could be handled by adding a no-op macro, eg "COPY_IGNORE(foo);")
It would be nice if we could also check that the macro type is sane for
the field datatype (eg, not use COPY_SCALAR_FIELD() for a pointer field).
But that would probably increase the difficulty very substantially for
just a small gain in error detection.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2015-10-22 21:13:36 | Re: Getting sorted data from foreign server |
Previous Message | Robert Haas | 2015-10-22 21:06:37 | Re: ATT_FOREIGN_TABLE and ATWrongRelkindError() |