Re: get_whatever_oid, part 1: object types with unqualifed names

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: get_whatever_oid, part 1: object types with unqualifed names
Date: 2010-06-28 17:00:12
Message-ID: 29764.1277744412@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 Mon, Jun 28, 2010 at 12:31 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Well, the whatever_exists() things would just be one-liner macros
>> declared in the same headers that declare the underlying
>> get_whatever_oid() functions. So the cost of carrying ones that happen
>> to not be used would be nil.

> True, but I think there's a pretty high chance that they woudn't get
> used even in places where they ought to, for lack of existing
> examples, or that new code would fail to add matching macros for new
> object types. Even so, it's not a terrible idea; I just don't think
> it should be a requirement for this particular patch. And to be
> honest, I'd sort of like to see how this shakes out before going too
> much further with it.

Well, once you've finished the get_whatever_oid() patch it won't be
hard to count how many instances of OidIsValid(get_whatever_oid()) there
are. If there's more than a few then I think the macros would be
appropriate to provide.

> Another, and related idea that I had while looking at this is that a
> lot of object types could benefit from a get_whatever_heaptuple()
> function with the same calling syntax. get_whatever_oid() could be
> restructured to use it, and most object types would have other
> callers, also. But that too seems like opening a larger can of worms
> than I really want to get into at this point.

This is the sort of thing that I think we should get right the first
time, rather than have multiple waves of large-scale changes.

I'm actually inclined to think we should try to land this stuff in 9.0
if we're going to do it at all. As a new committer, I suspect you do
not realize exactly how much pain this sort of thing inflicts on
back-patchers. The SearchSysCache call convention changes have already
ensured that the 8.4 to 9.0 crossover is going to be a major, major PITA
for back-patching, probably nearly as bad as the 8.1 changes in
pgindent's comment wrapping rules. (If I had it to do over I'd have
vetoed those changes --- I don't even want to think about how many
man-days I've lost to that completely useless cosmetic change.) This
proposed change will touch many of the same places that were already
modified for that. It'd be nice to have only one version boundary
where we're manually adjusting back-patched fixes, and not two.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2010-06-28 17:09:40 Re: Keepalive for max_standby_delay
Previous Message Tom Lane 2010-06-28 16:48:55 Re: Admission Control