Re: selecting from cursor

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alex Pilosov <alex(at)pilosoft(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: selecting from cursor
Date: 2001-07-03 17:34:08
Message-ID: 24992.994181648@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alex Pilosov <alex(at)pilosoft(dot)com> writes:
> On Tue, 3 Jul 2001, Tom Lane wrote:
>> So you have four (soon to be six or seven) different structs that *must*
>> have the same fields? I don't think that's cleaner than a union ...

> Please see my diffs. Its implemented via #define to declare all common
> fields.
> #define RTE_COMMON_FIELDS \
> NodeTag type; \
> [etc]

I don't think that technique is cleaner than a union, either ;-).
The macro definition is a pain in the neck: you have to play games with
semicolon placement, most tools won't autoindent it nicely, etc etc.

But the main point is that I think NodeType = RangeTblEntry with
a separate subtype field is a better way to go than making a bunch of
different NodeType values. When most of the fields are common, as in
this case, it's going to be true that many places only want to know
"is it a rangetable entry or not?"

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mikheev, Vadim 2001-07-03 17:41:53 RE: Re: Buffer access rules, and a probable bug
Previous Message Tom Lane 2001-07-03 17:06:25 Re: Re: Buffer access rules, and a probable bug