1999-01-27 17:15:22 +01:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
2002-10-15 01:49:20 +02:00
|
|
|
* spi_priv.h
|
1999-01-27 17:15:22 +01:00
|
|
|
* Server Programming Interface private declarations
|
|
|
|
*
|
2007-01-05 23:20:05 +01:00
|
|
|
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
|
2002-10-15 01:49:20 +02:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
2007-02-20 18:32:18 +01:00
|
|
|
* $PostgreSQL: pgsql/src/include/executor/spi_priv.h,v 1.27 2007/02/20 17:32:17 tgl Exp $
|
1999-01-27 17:15:22 +01:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef SPI_PRIV_H
|
|
|
|
#define SPI_PRIV_H
|
|
|
|
|
1999-07-14 03:20:30 +02:00
|
|
|
#include "executor/spi.h"
|
1999-01-27 17:15:22 +01:00
|
|
|
|
2002-10-15 01:49:20 +02:00
|
|
|
|
1999-01-27 17:15:22 +01:00
|
|
|
typedef struct
|
|
|
|
{
|
2005-10-01 20:43:19 +02:00
|
|
|
/* current results */
|
1999-01-27 17:15:22 +01:00
|
|
|
uint32 processed; /* by Executor */
|
2005-10-01 20:43:19 +02:00
|
|
|
Oid lastoid;
|
1999-01-27 17:15:22 +01:00
|
|
|
SPITupleTable *tuptable;
|
2005-10-01 20:43:19 +02:00
|
|
|
|
2000-06-28 05:33:33 +02:00
|
|
|
MemoryContext procCxt; /* procedure context */
|
|
|
|
MemoryContext execCxt; /* executor context */
|
1999-01-27 17:15:22 +01:00
|
|
|
MemoryContext savedcxt;
|
2005-10-15 04:49:52 +02:00
|
|
|
SubTransactionId connectSubid; /* ID of connecting subtransaction */
|
1999-01-27 17:15:22 +01:00
|
|
|
} _SPI_connection;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2004-03-21 23:29:11 +01:00
|
|
|
/* Context containing _SPI_plan itself as well as subsidiary data */
|
2001-05-21 16:22:19 +02:00
|
|
|
MemoryContext plancxt;
|
2004-03-21 23:29:11 +01:00
|
|
|
/* Original query string (used for error reporting) */
|
|
|
|
const char *query;
|
2007-02-20 18:32:18 +01:00
|
|
|
/*
|
|
|
|
* List of List of PlannedStmts and utility stmts; one sublist per
|
|
|
|
* original parsetree
|
|
|
|
*/
|
|
|
|
List *stmt_list_list;
|
2002-10-15 01:49:20 +02:00
|
|
|
/* Argument types, if a prepared plan */
|
1999-01-27 17:15:22 +01:00
|
|
|
int nargs;
|
|
|
|
Oid *argtypes;
|
|
|
|
} _SPI_plan;
|
|
|
|
|
2002-10-15 01:49:20 +02:00
|
|
|
|
1999-01-27 17:15:22 +01:00
|
|
|
#define _SPI_CPLAN_CURCXT 0
|
|
|
|
#define _SPI_CPLAN_PROCXT 1
|
|
|
|
#define _SPI_CPLAN_TOPCXT 2
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* SPI_PRIV_H */
|