pgjdbc / r2dbc-postgresql

Postgresql R2DBC Driver
https://r2dbc.io
Apache License 2.0
1.01k stars 177 forks source link

Why is the contents of the table not displayed in r2dbc-postgres? #620

Closed AdaMorgan closed 10 months ago

AdaMorgan commented 10 months ago

Discussed in https://github.com/pgjdbc/r2dbc-postgresql/discussions/619

Originally posted by **AdaMorgan** December 23, 2023 I want to display the contents of the ids column, but it is not displayed, and also does not give any error. ```java private static final String GET_DATA = "SELECT * FROM public.user"; public static @NotNull ConnectionFactory init() { return ConnectionFactories.get(ConnectionFactoryOptions.builder() .option(DRIVER, "postgresql") .option(HOST, "localhost") .option(PORT, 5432) .option(USER, "postgres") .option(PASSWORD, "postgres") .option(DATABASE, "user") .build()); } public static void main(String[] args) { Mono.from(init().create()) .map(connection -> getFlux(connection).toList()) .doOnError(error -> error.printStackTrace()) .subscribe(System.out::println); } public static Stream getFlux(@NotNull Connection connection) { return Flux.from(connection.createStatement(GET_DATA).execute()) .doOnError(error -> error.printStackTrace()) .flatMap(result -> result.map((row, rowMetadata) -> row.get("ids", String.class))) .toStream(); } ```

version r2dbc: 1.0.3.RELEASE

debug

17:11:26 main Loggers DEBUG Using Slf4j logging framework 17:11:26 main Extensions DEBUG Discovering Extensions using ServiceLoader 17:11:26 main Extensions DEBUG Registering extension io.r2dbc.postgresql.codec.BuiltinDynamicCodecs 17:11:27 main InternalLoggerF DEBUG Using SLF4J as the default logging framework 17:11:27 main PlatformDepende DEBUG -Dio.netty.noUnsafe: false 17:11:27 main PlatformDepende DEBUG Java version: 19 17:11:27 main PlatformDepende DEBUG sun.misc.Unsafe.theUnsafe: available 17:11:27 main PlatformDepende DEBUG sun.misc.Unsafe.copyMemory: available 17:11:27 main PlatformDepende DEBUG sun.misc.Unsafe.storeFence: available 17:11:27 main PlatformDepende DEBUG java.nio.Buffer.address: available 17:11:27 main PlatformDepende DEBUG direct buffer constructor: unavailable: Reflective setAccessible(true) disabled 17:11:27 main PlatformDepende DEBUG java.nio.Bits.unaligned: available, true 17:11:27 main PlatformDepende DEBUG jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable: class io.netty.util.internal.PlatformDependent0$7 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @3891771e 17:11:27 main PlatformDepende DEBUG java.nio.DirectByteBuffer.(long, {int,long}): unavailable 17:11:27 main PlatformDepende DEBUG sun.misc.Unsafe: available 17:11:27 main PlatformDepende DEBUG -Dio.netty.tmpdir: C:\Users\JOHNRE~1\AppData\Local\Temp (java.io.tmpdir) 17:11:27 main PlatformDepende DEBUG -Dio.netty.bitMode: 64 (sun.arch.data.model) 17:11:27 main PlatformDepende DEBUG Platform: Windows 17:11:27 main PlatformDepende DEBUG -Dio.netty.maxDirectMemory: -1 bytes 17:11:27 main PlatformDepende DEBUG -Dio.netty.uninitializedArrayAllocationThreshold: -1 17:11:27 main CleanerJava9 DEBUG java.nio.ByteBuffer.cleaner(): available 17:11:27 main PlatformDepende DEBUG -Dio.netty.noPreferDirect: false 17:11:27 main ResourceLeakDet DEBUG -Dio.netty.leakDetection.level: simple 17:11:27 main ResourceLeakDet DEBUG -Dio.netty.leakDetection.targetRecords: 4 17:11:27 main TcpResources DEBUG [tcp] resources will use the default LoopResources: DefaultLoopResources {prefix=reactor-tcp, daemon=true, selectCount=12, workerCount=12} 17:11:27 main TcpResources DEBUG [tcp] resources will use the default ConnectionProvider: reactor.netty.resources.DefaultPooledConnectionProvider@4201c465 17:11:27 main DefaultLoopIOUr DEBUG Default io_uring support : false 17:11:27 main DefaultLoopEpol DEBUG Default Epoll support : false 17:11:27 main DefaultLoopKQue DEBUG Default KQueue support : false 17:11:27 main MultithreadEven DEBUG -Dio.netty.eventLoopThreads: 24 17:11:27 main GlobalEventExec DEBUG -Dio.netty.globalEventExecutor.quietPeriodSeconds: 1 17:11:27 main InternalThreadL DEBUG -Dio.netty.threadLocalMap.stringBuilder.initialSize: 1024 17:11:27 main InternalThreadL DEBUG -Dio.netty.threadLocalMap.stringBuilder.maxSize: 4096 17:11:27 main NioEventLoop DEBUG -Dio.netty.noKeySetOptimization: false 17:11:27 main NioEventLoop DEBUG -Dio.netty.selectorAutoRebuildThreshold: 512 17:11:27 main PlatformDepende DEBUG org.jctools-core.MpscChunkedArrayQueue: available 17:11:27 main DefaultChannelI DEBUG -Dio.netty.processId: 7828 (auto-detected) 17:11:27 main NetUtil DEBUG -Djava.net.preferIPv4Stack: false 17:11:27 main NetUtil DEBUG -Djava.net.preferIPv6Addresses: false 17:11:27 main NetUtilInitiali DEBUG Loopback interface: lo (Software Loopback Interface 1, 127.0.0.1) 17:11:27 main NetUtil DEBUG Failed to get SOMAXCONN from sysctl and file \proc\sys\net\core\somaxconn. Default: 200 17:11:27 main DefaultChannelI DEBUG -Dio.netty.machineId: 00:15:5d:ff:fe:70:c3:e2 (auto-detected) 17:11:27 main PooledByteBufAl DEBUG -Dio.netty.allocator.numHeapArenas: 24 17:11:27 main PooledByteBufAl DEBUG -Dio.netty.allocator.numDirectArenas: 24 17:11:27 main PooledByteBufAl DEBUG -Dio.netty.allocator.pageSize: 8192 17:11:27 main PooledByteBufAl DEBUG -Dio.netty.allocator.maxOrder: 9 17:11:27 main PooledByteBufAl DEBUG -Dio.netty.allocator.chunkSize: 4194304 17:11:27 main PooledByteBufAl DEBUG -Dio.netty.allocator.smallCacheSize: 256 17:11:27 main PooledByteBufAl DEBUG -Dio.netty.allocator.normalCacheSize: 64 17:11:27 main PooledByteBufAl DEBUG -Dio.netty.allocator.maxCachedBufferCapacity: 32768 17:11:27 main PooledByteBufAl DEBUG -Dio.netty.allocator.cacheTrimInterval: 8192 17:11:27 main PooledByteBufAl DEBUG -Dio.netty.allocator.cacheTrimIntervalMillis: 0 17:11:27 main PooledByteBufAl DEBUG -Dio.netty.allocator.useCacheForAllThreads: false 17:11:27 main PooledByteBufAl DEBUG -Dio.netty.allocator.maxCachedByteBuffersPerChunk: 1023 17:11:27 main ByteBufUtil DEBUG -Dio.netty.allocator.type: pooled 17:11:27 main ByteBufUtil DEBUG -Dio.netty.threadLocalDirectBufferSize: 0 17:11:27 main ByteBufUtil DEBUG -Dio.netty.maxThreadLocalCharBufferSize: 16384