On Mon, 2 Jul 2001, Alex Pilosov wrote:
> Erm, forgot to attach the patch. Here it is.
(yow) don't even bother looking at this patch. mail server delayed this
message by almost a week, and by now, the code is totally changed.
I took Tom's suggestion and made RTE a union. So, the below is a new
definition of RTE:
I have most of portal-related code working, only executor needs some more
fixes. Code properly makes PortalScan Path entry, PortalScan Plan nodes,
etc. I have added PortalReScan to tell portal it needs to rescan itself.
I'll post a correct patch next week. Thank you to everyone and especially
Tom for bearing with my often stupid questions.
--cut here--rte definition--
typedef enum RTEType { RTE_RELATION, RTE_SUBSELECT, RTE_PORTAL
} RTEType;
typedef struct RangeTblEntry
{ NodeTag type; RTEType rtetype; /* * Fields valid in all RTEs: */ Attr *alias; /*
user-writtenalias clause, if any */ Attr *eref; /* expanded reference names */ bool inh;
/* inheritance requested? */ bool inFromCl; /* present in FROM clause */ bool
checkForRead; /* check rel for read access */ bool checkForWrite; /* check rel for write access */ Oid
checkAsUser; /* if not zero, check access as this user
*/ union { struct { /* Fields for a plain relation RTE (rtetype=RTE_RELATION) */ char
*relname; /* real name of the relation */ Oid relid; /* OID of the relation */
} rel; struct { /* Fields for a subquery RTE (rtetype=RTE_SUBSELECT) */ Query *subquery;
/* the sub-query */ } sub; struct { /* fields for portal RTE (rtetype=RTE_PORTAL) */
char *portalname; /* portal's name */ } portal; } u;
} RangeTblEntry;