Skip to content

Commit

Permalink
pgjdbcgh-648 only get oid and typarray when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Hall committed Apr 10, 2024
1 parent 079b565 commit 7df2200
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ public Publisher<Void> register(PostgresqlConnection connection, ByteBufAllocato
return statement.execute()
.flatMap(it -> it.map((row, rowMetadata) -> {

int oid = PostgresqlObjectId.toInt(row.get("oid", Long.class));
int typarray = rowMetadata.contains("typarray") ? PostgresqlObjectId.toInt(row.get("typarray", Long.class)) : PostgresTypes.NO_SUCH_TYPE;
String typname = row.get("typname", String.class);

BuiltinCodec lookup = BuiltinCodec.lookup(typname);
if (lookup.isSupported()) {
int oid = PostgresqlObjectId.toInt(row.get("oid", Long.class));
int typarray = rowMetadata.contains("typarray") ? PostgresqlObjectId.toInt(row.get("typarray", Long.class)) : PostgresTypes.NO_SUCH_TYPE;
lookup.createCodec(byteBufAllocator, oid, typarray).forEach(registry::addLast);
}

Expand Down

0 comments on commit 7df2200

Please sign in to comment.