Skip site navigation (1) Skip section navigation (2)

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 18:38:08
Message-ID: 25219.994185488@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Alex Pilosov <alex(at)pilosoft(dot)com> writes:
> True true. On other hand, unlike union, its automatically typechecked, you
> cannot by mistake reference a field you shouldn't be referencing.

Only true to the extent that you have cast a generic pointer to the
correct type to begin with.  However, we've probably wasted more time
arguing the point than it's really worth.

I would suggest leaving off the final semicolon in the macro definition
so that you can write

typedef struct RangeTblEntryRelation
{
    RTE_COMMON_FIELDS;
    /* Fields valid for a plain relation RTE */
    char       *relname;        /* real name of the relation */
    Oid         relid;          /* OID of the relation */

Without this, tools like pgindent will almost certainly mess up these
struct declarations (I know emacs' C mode will get it wrong...)

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2001-07-03 19:01:05
Subject: Re: stuck spin lock with many concurrent users
Previous:From: Naomi WalkerDate: 2001-07-03 18:16:28
Subject: Re: [OT] Any major users of postgresql?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group