java.lang.Object
org.postgresql.pljava.internal.SPI
The
SPI
class provides access to some global
variables used by SPI.- Author:
- Thomas Hallgren
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
Deprecated.This seems never to have been used in git history of project.static void
Frees a tuple table returned by SPI.static long
Returns the value of the global variableSPI_processed
.static int
Returns the value of the global variableSPI_result
.static String
getResultText
(int resultCode) Returns a textual representation of a result code.static TupleList
getTuples
(TupleTableSlotImpl ttsi) Returns a List of the supplied TupleTableSlot covering the tuples pointed to from the pointer array that the globalSPI_tuptable
points to.static TupleTable
getTupTable
(TupleDesc known) Returns the tuples located by the global variableSPI_tuptable
as an instance of the legacyTupleTable
class.
-
Field Details
-
ERROR_CONNECT
public static final int ERROR_CONNECT- See Also:
-
ERROR_COPY
public static final int ERROR_COPY- See Also:
-
ERROR_OPUNKNOWN
public static final int ERROR_OPUNKNOWN- See Also:
-
ERROR_UNCONNECTED
public static final int ERROR_UNCONNECTED- See Also:
-
ERROR_CURSOR
public static final int ERROR_CURSOR- See Also:
-
ERROR_ARGUMENT
public static final int ERROR_ARGUMENT- See Also:
-
ERROR_PARAM
public static final int ERROR_PARAM- See Also:
-
ERROR_TRANSACTION
public static final int ERROR_TRANSACTION- See Also:
-
ERROR_NOATTRIBUTE
public static final int ERROR_NOATTRIBUTE- See Also:
-
ERROR_NOOUTFUNC
public static final int ERROR_NOOUTFUNC- See Also:
-
ERROR_TYPUNKNOWN
public static final int ERROR_TYPUNKNOWN- See Also:
-
ERROR_REL_DUPLICATE
public static final int ERROR_REL_DUPLICATE- See Also:
-
ERROR_REL_NOT_FOUND
public static final int ERROR_REL_NOT_FOUND- See Also:
-
OK_CONNECT
public static final int OK_CONNECT- See Also:
-
OK_FINISH
public static final int OK_FINISH- See Also:
-
OK_FETCH
public static final int OK_FETCH- See Also:
-
OK_UTILITY
public static final int OK_UTILITY- See Also:
-
OK_SELECT
public static final int OK_SELECT- See Also:
-
OK_SELINTO
public static final int OK_SELINTO- See Also:
-
OK_INSERT
public static final int OK_INSERT- See Also:
-
OK_DELETE
public static final int OK_DELETE- See Also:
-
OK_UPDATE
public static final int OK_UPDATE- See Also:
-
OK_CURSOR
public static final int OK_CURSOR- See Also:
-
OK_INSERT_RETURNING
public static final int OK_INSERT_RETURNING- See Also:
-
OK_DELETE_RETURNING
public static final int OK_DELETE_RETURNING- See Also:
-
OK_UPDATE_RETURNING
public static final int OK_UPDATE_RETURNING- See Also:
-
OK_REWRITTEN
public static final int OK_REWRITTEN- See Also:
-
OK_REL_REGISTER
public static final int OK_REL_REGISTER- See Also:
-
OK_REL_UNREGISTER
public static final int OK_REL_UNREGISTER- See Also:
-
OK_TD_REGISTER
public static final int OK_TD_REGISTER- See Also:
-
OK_MERGE
public static final int OK_MERGE- See Also:
-
OPT_NONATOMIC
public static final int OPT_NONATOMIC- See Also:
-
-
Constructor Details
-
SPI
public SPI()
-
-
Method Details
-
exec
Deprecated.This seems never to have been used in git history of project.Execute a command using the internalSPI_exec
function.- Parameters:
command
- The command to execute.rowCount
- The maximum number of tuples to create. A value ofrowCount
of zero is interpreted as no limit, i.e., run to completion.- Returns:
- One of the declared status codes.
-
freeTupTable
public static void freeTupTable()Frees a tuple table returned by SPI.This legacy method has no parameter, and frees whatever tuple table the
SPI_tuptable
global points to at the moment; beware if SPI has returned any newer result since the one you might think you are freeing! -
getProcessed
public static long getProcessed()Returns the value of the global variableSPI_processed
. -
getResult
public static int getResult()Returns the value of the global variableSPI_result
. -
getTuples
Returns a List of the supplied TupleTableSlot covering the tuples pointed to from the pointer array that the globalSPI_tuptable
points to.This is an internal, not an API, method, and it does nothing to check that the supplied ttsi fits the tuples SPI has returned. The caller is to ensure that.
- Returns:
- null if the global SPI_tuptable is null
-
getTupTable
Returns the tuples located by the global variableSPI_tuptable
as an instance of the legacyTupleTable
class. -
getResultText
Returns a textual representation of a result code.
-