- java.lang.Object
-
- org.postgresql.pljava.internal.Relation
-
public class Relation extends Object
TheRelation
correspons to the internal PostgreSQLRelation
.- Author:
- Thomas Hallgren
-
-
Method Summary
Modifier and Type Method Description String
getName()
Returns the name of thisRelation
.String
getSchema()
Returns the schema name of thisRelation
.TupleDesc
getTupleDesc()
Returns a descriptor that describes tuples in thisRelation
.Tuple
modifyTuple(Tuple original, int[] fieldNumbers, Object[] values)
Creates a newTuple
by substituting new values for selected columns copying the columns of the originalTuple
at other positions.
-
-
-
Method Detail
-
getName
public String getName() throws SQLException
Returns the name of thisRelation
.- Throws:
SQLException
-
getSchema
public String getSchema() throws SQLException
Returns the schema name of thisRelation
.- Throws:
SQLException
-
getTupleDesc
public TupleDesc getTupleDesc() throws SQLException
Returns a descriptor that describes tuples in thisRelation
.- Throws:
SQLException
-
modifyTuple
public Tuple modifyTuple(Tuple original, int[] fieldNumbers, Object[] values) throws SQLException
Creates a newTuple
by substituting new values for selected columns copying the columns of the originalTuple
at other positions. The originalTuple
is not modified.Note: starting with PostgreSQL 10, this method can fail if SPI is not connected; it is the caller's responsibility in PG 10 and up to ensure that SPI is connected and that a longer-lived memory context than SPI's has been selected, if the caller wants the result of this call to survive
SPI_finish
.- Parameters:
original
- The tuple that serves as the source.fieldNumbers
- An array of one based indexes denoting the positions that are to receive modified values.values
- The array of new values. Each value in this array corresponds to an index in thefieldNumbers
array.- Returns:
- A copy of the original with modifications.
- Throws:
SQLException
- if indexes are out of range or the values illegal.
-
-