Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1seDT6-0051K8-KF for pgsql-general@arkaria.postgresql.org; Wed, 14 Aug 2024 12:51:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1seDT5-00AC2P-6W for pgsql-general@arkaria.postgresql.org; Wed, 14 Aug 2024 12:51:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1seDT4-00AC2G-Rh for pgsql-general@lists.postgresql.org; Wed, 14 Aug 2024 12:51:10 +0000 Received: from mail-oo1-xc33.google.com ([2607:f8b0:4864:20::c33]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1seDT2-004oij-Qk for pgsql-general@lists.postgresql.org; Wed, 14 Aug 2024 12:51:10 +0000 Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-5d5ed6f51cfso4401864eaf.0 for ; Wed, 14 Aug 2024 05:51:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723639867; x=1724244667; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=YESiMp8Kd4ZUbHbjcU1iHqMeSVMrVLIhfTGB7fLHsiE=; b=ahYfyaIOWeV1ZvcAd51tXEH4P17BKoMocXteAMh9TEDnxOy37oYz3ayTVvDGGgY7hB Gd0ryOjHLm526iqRCsfkOlXBaKrsLwGr+elJs5Qq50ukwPF7g641i9M6XLXNwbmQ34gi /+UMb65Z4FoeEICU+/8N49WNbBDhIacqAf6Bsar6LEzXrNWso2WRgLhDoqInvHhecibf 4JQLbKH8fxjPKlW+8T+kul2HoHEVStP7mJ1BB5eub+SU8XrOCbUksLecJ+0NXKWCMusd be7/F/w32hETQa1+y/uKjwAr840kNrj7lxNeEkcBvu093/xkOQv0eki40tA+ilYEZ7ER XhwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723639867; x=1724244667; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=YESiMp8Kd4ZUbHbjcU1iHqMeSVMrVLIhfTGB7fLHsiE=; b=PbEGS1BlEUB1NKHO/bdo4WfvIX/G4IcdA+wqs57SzeeWmz1h2Pnq6yo24FZyqTCooM xD7ketqC3hA/nskIe6zI8dh7tgxIjHvS0SpUi99SSu9U2TdQgnvAzE4AxRwlPP3UQYml gtL9FqH8vj2l39Ye7mYcSrdQagdHhpJ3zWbvncoL/PWSlVZgkQo8Z9AtHPy/pdpxbSin OnEuARa0+A3dO+DUsC1XlOqkd1JjrSr8k2+A/WEsV6InfFpNmPmjuyg6pWhsFlY/pMxy 4qbl3sGo4BFktl/hQl4w9FP2mTA7zU7gcl0jKve30ivUaBrk7OF/Rrubff+5WoUOd3mo V7/g== X-Gm-Message-State: AOJu0YwUfVnbvPOQzpGVpBaH/WFRLkVds8ix7O4pxQzWJ9Zw3v+TzO79 pGzCoH5pQeenJ6VFrnDiskzejhGwWNpqRq22EsrQh5XPLyoxTMkeVScNy2dNPtEc5dWskXWKSf0 qcd8ZlBNzGrN9UCIlVgjCk7x7nOP8GYIv X-Google-Smtp-Source: AGHT+IGljPp3+w6LfRh73zUnFAHeos6XX/6dEg67G7x6fo7NkKr556UWK9zMNo+xjcKWOhJfau4IlaRnS53w9PMix7g= X-Received: by 2002:a05:6820:2207:b0:5ce:f75b:1755 with SMTP id 006d021491bc7-5da7c6c0191mr3127860eaf.4.1723639866885; Wed, 14 Aug 2024 05:51:06 -0700 (PDT) MIME-Version: 1.0 From: Dominique Devienne Date: Wed, 14 Aug 2024 14:50:55 +0200 Message-ID: Subject: Using PQsocketPoll() for PIPELINE mode To: pgsql-general@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi. I've now used successfully the new PQsocketPoll() API in the context of waiting for notifications, using beta2 and 3. But now I'm looking into using it in the context of PIPELINE mode. Where I suppose both forRead and forWrite are 1, but the return code only indicates whether the condition is met. The doc says nothing about OR or AND semantic, when both forRead and forWrite are true. Perhaps it's deemed obvious from the use of select() or poll()? Or is one supposed to call it once with forRead=forWrite=1 and a timeout, then call it again twice with just one forFlag set and a 0 timeout, to know the "details" about which "side" is ready? Or hasn't this use case been considered for PQsocketPoll(), and thus the current return code isn't has precise as it could be? Thanks for any precisions, --DD