RowDescription packet

A RowDescription packet is sent by the server at the beginning of a result set, after a Query or Execute packet.

Methods

  • List<FieldDescriptor> getFields() : get all the field descriptors

  • FieldDescriptor getFieldByName(String name) : gets one specific field descriptor. Keep in mind that it is possible to have two fields with the same name in one result set, for instance if the result set spans multiple tables that have columns with the same name. In that case, this method will return the first one it finds.


In turn, a FieldDescriptor object has the following methods:

  • String getSchemaName() : gets the name of the schema from which this field comes. Can be null if the field is derived.

  • String getTableName() : gets the name of the table from which this field comes. Can be null if the field is derived.

  • long getObjectID() : gets the Postgres object ID of the table that contains the field, if any.

  • String getFieldName() : gets the name of the field.

  • boolean isComposite() : returns true if the data type of the field is composite, meaning it's not a primitive type.

  • boolean isEnum() : returns true if the data type of the field is an enum type.

  • boolean isArray() : returns true if the data type of the field is an array type.

  • boolean isRange() : returns true if the data type of the field is a range type.

  • int getAttributeNumber() : if the field comes from a table, the attribute number of the field in that table.

  • int getDataTypeID() : gets the Postgres object ID of the data type of the field.

  • int getDataTypeSize() : gets the size of the field, if relevant. Can be negative for variable sizes.

  • int getTypeModifier() : gets the type modifier, which is type-dependent.

  • int getFormatCode() : gets the format code, can be zero (text) or one (binary).