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.96) (envelope-from ) id 1vVyzC-00AHur-2U for pgsql-general@arkaria.postgresql.org; Wed, 17 Dec 2025 21:23:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vVyzA-00Gdho-1N for pgsql-general@arkaria.postgresql.org; Wed, 17 Dec 2025 21:23:05 +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.96) (envelope-from ) id 1vVyzA-00Gdhg-0H for pgsql-general@lists.postgresql.org; Wed, 17 Dec 2025 21:23:04 +0000 Received: from mail-yw1-x1131.google.com ([2607:f8b0:4864:20::1131]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vVyz8-001IaJ-1I for pgsql-general@lists.postgresql.org; Wed, 17 Dec 2025 21:23:04 +0000 Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-78c5adeb964so62502877b3.1 for ; Wed, 17 Dec 2025 13:23:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766006580; x=1766611380; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=EC9/q+7hYaWKG9d1h6Vl6+WcRaq7HKGKKTWytsB6E5M=; b=deAAJ0zxL28SdG5Gxd6nmUwTCD3FU8C9GD1jpjKDqjaerABHskrOOCKnEnRzabSRCl 8dmlQjKPMzTWMdl/w+BAArL+Z69SQm8mGdlzHmxUsKYY0P43+9zYVl2rg7xy8i7+WoH2 3ZBV0pDyjVpGasUiRCUdNFhAVq5LrEoayZk9OxkMCv4rD4xVv0SRym85UtvcCOhjsyat A7y1vJ649eoucCG9OlcR4VpxvBZlTf0tQtYoS1Cskjkl+8OLcj4lahI6xu/pJ/nvzXx6 8JyxLsMvJ9SIOmnqyYnUNtJEWPzgeNGUCr7pSuLEuZFEqElcrXFsIela7q1c6a7/M9Gv XPKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766006580; x=1766611380; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=EC9/q+7hYaWKG9d1h6Vl6+WcRaq7HKGKKTWytsB6E5M=; b=VmhNs7/9md/RZdhS+jizBL3QqOYy0eJcMLcTsD7x6kCy5j97x6T/DE4GO2Wfp0YNTf c3DzKEw9y5FdAwTSpuzXqpPZtZEuYMixZtv9igISca2S2QB326ek1v8B74MExmZ1Ic/j vxnSVdwXUG2tbO2soupSOBFCdRbTykrEFXKucVApZ1h5sgOq8e7l5vtPvLSgJcaOXW/+ nc7fb9oSkJQMvjwEcDST009eHq3q3s3F0S7vd1SIlwq2Uu4BczCBBRnrzqm4vjMGm6YT CGSLjnc6raJqSahliVcoKWq8frUcusMaJAEo6iQIoopJpQQ1mBDfKyqwLl+vEZBJuU6G L3rw== X-Forwarded-Encrypted: i=1; AJvYcCXugErvv86a4/Kqb0yHtl35EDQfaaphbYSMV1uCIBBp3Fu0/fxJA/9IswBl6Dfeskbzwsfu3RbbqX/JrdM2@lists.postgresql.org X-Gm-Message-State: AOJu0Ywo1yKOC/8rBfuQoYV/+ip7PBO0lQw5kJMVp/CdnbR+yJPFGCIL JlHAIyMH38oySZXcELFFHY7xzG9sFhGCmu7k1a0LZq0Uq7Tr5lYnvoa6CfwbZALDI+KMN9gV5xO +N4KbAODmY8JOeJs1zdvp04Iw0D5+RIg= X-Gm-Gg: AY/fxX5s11vHeVXPWxDRgNTjS+neqxMZNJclskqOIQeWU06MDlCZJyx+vo0zVt7qYvf DuuNJ6Q0lr2XaXbhYC3VjCoimcVeSZTW7pZrSSsMj6vHBG1wdtY1rpzEY7NzRFcKl5qAxT9FR4r YFkeGNkhuJUTIieWaNwcYnQB6P84f3fq/MvUD8fE0r0SbMyoEMNAbzlgXe7suVrQiYqvN+Qk6E1 9uyOyaViT22WrqPBDZQ4+GN8ECc3xI4Fu+OPKHXarB5m4TaeIUxUxTwYMCNLnIWjm3fVtqlyS7D iiTBiQf4LSlNFaQcwG71aXuZhyg= X-Google-Smtp-Source: AGHT+IFxwoH/ldDjQXF+79wQ667YseROv0rYZU+UM4ioYMz0cbn7D373CSnNBrHF7cOLUbbq7mz4acnBcAYnnQsentQ= X-Received: by 2002:a05:690e:400f:b0:644:60d9:8667 with SMTP id 956f58d0204a3-6455567bdf2mr14575900d50.88.1766006580427; Wed, 17 Dec 2025 13:23:00 -0800 (PST) MIME-Version: 1.0 References: <3fd9c2859c323d6f894ccf660764f24dc3423181.camel@cybertec.at> In-Reply-To: From: Igor Korot Date: Wed, 17 Dec 2025 13:22:57 -0800 X-Gm-Features: AQt7F2rUmyDJRnjbA_lWYNpenW-FaFxVt0h66dmnispKK9LfYe3TlQhcr_NUcbU Message-ID: Subject: Re: libpq simple SELECT To: "David G. Johnston" Cc: Laurenz Albe , "pgsql-generallists.postgresql.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David,, On Wed, Dec 17, 2025 at 1:14=E2=80=AFPM David G. Johnston wrote: > > On Wednesday, December 17, 2025, Igor Korot wrote: >> >> >> I hope now my question is clear. I want to know if using CURSR >> is a must. > > > No it is not. But there isn=E2=80=99t an example of doing so without a c= ursor because it is deemed trivial enough that a competent C writer can fig= ure it out. In particular, it basically is just the same code as the =E2= =80=9Cfetch=E2=80=9D portion of the example, but the select command is supp= lied instead of a fetch command. Both of those SQL commands result is tupl= es being generated. So what do I do after calling PQexec()? And why is my code running only onc= e? Thank you. > > David J. >