Skip to content

Implement write methods that are not yet supported in PostgreSQLBinaryProtocolValue #35830

@RaigorJiang

Description

@RaigorJiang

PostgreSQLBinaryProtocolValue is an interface for handling Binary type data in the PostgreSQL protocol, and currently has 21 implementation classes.

Image

However, some write methods have not been implemented, which needs to be improved.
For example:

public final class PostgreSQLBoolBinaryProtocolValue implements PostgreSQLBinaryProtocolValue {
    
    @Override
    public int getColumnLength(final Object value) {
        return 1;
    }
    
    @Override
    public Object read(final PostgreSQLPacketPayload payload, final int parameterValueLength) {
        return payload.getByteBuf().readBoolean();
    }
    
    @Override
    public void write(final PostgreSQLPacketPayload payload, final Object value) {
        throw new UnsupportedSQLOperationException("PostgreSQLBoolBinaryProtocolValue.write()");
    }
}

task list

  • PostgreSQLBoolArrayBinaryProtocolValue
  • PostgreSQLBoolBinaryProtocolValue
  • PostgreSQLFloat4ArrayBinaryProtocolValue
  • PostgreSQLFloat8ArrayBinaryProtocolValue
  • PostgreSQLInt2ArrayBinaryProtocolValue
  • PostgreSQLInt4ArrayBinaryProtocolValue
  • PostgreSQLInt8ArrayBinaryProtocolValue
  • PostgreSQLArrayParameterDecoder
  • PostgreSQLTextArrayBinaryProtocolValue
  • PostgreSQLUnspecifiedBinaryProtocolValue

Note:

PostgreSQL supports text and binary data transfer. PostgreSQL drivers used by different development languages ​​may choose different way.
These binary write methods may not be triggered by JDBC clients and need to be verified using other clients.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions