You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/08/25 07:46:36 UTC

[GitHub] [shardingsphere] sandynz edited a comment on issue #6579: Cannot find PostgreSQL type 'POSTGRESQL_TYPE_UNSPECIFIED' in column type when process binary protocol value

sandynz edited a comment on issue #6579:
URL: https://github.com/apache/shardingsphere/issues/6579#issuecomment-678653755


   After fixing `IllegalArgumentException: Cannot find PostgreSQL type 'POSTGRESQL_TYPE_UNSPECIFIED' in column type when process binary protocol value`, there's new exception thrown:
   ```
   Exception in thread "main" org.postgresql.util.PSQLException: ERROR: column "create_time" is of type timestamp without time zone but expression is of type bytea
   ```
   From PostgreSQL driver source, Date/Time/Timestamp/Distinct/Other will use Oid.UNSPECIFIED, all of them set parameter as string, so read unsepcified parameter as string. but still exception:
   ```
   Exception in thread "main" org.postgresql.util.PSQLException: ERROR: column "create_time" is of type timestamp without time zone but expression is of type character varying
   ```
   
   Since `BackendConnection` use `PreparedStatement.setObject(int parameterIndex, Object x)`, Oid is changed as ``x`'s` Java object type, e.g. String. In order to keep Oid.UNSPECIFIED, a new type `TypeUnspecifiedSQLParameter` added.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org