1996-08-28 03:59:28 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* portal.h
|
1997-09-07 07:04:48 +02:00
|
|
|
* POSTGRES portal definitions.
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
*
|
2001-01-24 20:43:33 +01:00
|
|
|
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
2001-01-24 20:43:33 +01:00
|
|
|
* $Id: portal.h,v 1.25 2001/01/24 19:43:28 momjian Exp $
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* Note:
|
1997-09-07 07:04:48 +02:00
|
|
|
* A portal is an abstraction which represents the execution state of
|
2000-06-28 05:33:33 +02:00
|
|
|
* a running query (or a fixed sequence of queries).
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
* Note:
|
1997-09-07 07:04:48 +02:00
|
|
|
* now that PQ calls can be made from within a backend, a portal
|
|
|
|
* may also be used to keep track of the tuples resulting
|
|
|
|
* from the execution of a query. In this case, entryIndex
|
1996-08-28 03:59:28 +02:00
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
#ifndef PORTAL_H
|
1996-08-28 03:59:28 +02:00
|
|
|
#define PORTAL_H
|
|
|
|
|
1999-07-16 01:04:24 +02:00
|
|
|
#include "executor/execdesc.h"
|
|
|
|
#include "nodes/memnodes.h"
|
1996-08-28 03:59:28 +02:00
|
|
|
|
|
|
|
|
2000-06-28 05:33:33 +02:00
|
|
|
typedef struct PortalD *Portal;
|
1996-08-28 03:59:28 +02:00
|
|
|
|
2000-06-28 05:33:33 +02:00
|
|
|
typedef struct PortalD
|
1997-09-07 07:04:48 +02:00
|
|
|
{
|
2000-06-28 05:33:33 +02:00
|
|
|
char *name; /* Portal's name */
|
|
|
|
MemoryContext heap; /* subsidiary memory */
|
|
|
|
QueryDesc *queryDesc; /* Info about query associated with portal */
|
1997-09-08 04:41:22 +02:00
|
|
|
TupleDesc attinfo;
|
|
|
|
EState *state;
|
2000-06-28 05:33:33 +02:00
|
|
|
void (*cleanup) (Portal); /* Cleanup routine (optional) */
|
|
|
|
} PortalD;
|
1996-08-28 03:59:28 +02:00
|
|
|
|
|
|
|
/*
|
1999-05-25 18:15:34 +02:00
|
|
|
* PortalIsValid
|
1997-09-07 07:04:48 +02:00
|
|
|
* True iff portal is valid.
|
1996-08-28 03:59:28 +02:00
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
#define PortalIsValid(p) PointerIsValid(p)
|
1996-08-28 03:59:28 +02:00
|
|
|
|
2000-06-28 05:33:33 +02:00
|
|
|
extern void EnablePortalManager(void);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void AtEOXact_portals(void);
|
2000-06-28 05:33:33 +02:00
|
|
|
extern Portal CreatePortal(char *name);
|
|
|
|
extern void PortalDrop(Portal *portalP);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern Portal GetPortalByName(char *name);
|
1998-09-01 06:40:42 +02:00
|
|
|
extern void PortalSetQuery(Portal portal, QueryDesc *queryDesc,
|
1997-09-08 23:56:23 +02:00
|
|
|
TupleDesc attinfo, EState *state,
|
1997-09-07 07:04:48 +02:00
|
|
|
void (*cleanup) (Portal portal));
|
1996-08-28 03:59:28 +02:00
|
|
|
extern QueryDesc *PortalGetQueryDesc(Portal portal);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern EState *PortalGetState(Portal portal);
|
2000-06-28 05:33:33 +02:00
|
|
|
extern MemoryContext PortalGetHeapMemory(Portal portal);
|
1996-08-28 03:59:28 +02:00
|
|
|
|
|
|
|
/* estimate of the maximum number of open portals a user would have,
|
2000-06-28 05:33:33 +02:00
|
|
|
* used in initially sizing the PortalHashTable in EnablePortalManager()
|
1996-08-28 03:59:28 +02:00
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
#define PORTALS_PER_USER 10
|
1996-08-28 03:59:28 +02:00
|
|
|
|
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* PORTAL_H */
|