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 1vVvFx-009kJT-2f for pgsql-general@arkaria.postgresql.org; Wed, 17 Dec 2025 17:24:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vVvFw-00FC7k-2Y for pgsql-general@arkaria.postgresql.org; Wed, 17 Dec 2025 17:24:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVvFw-00FC7a-1V for pgsql-general@lists.postgresql.org; Wed, 17 Dec 2025 17:24:09 +0000 Received: from mail-oo1-xc35.google.com ([2607:f8b0:4864:20::c35]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vVvFv-001Bf8-2x for pgsql-general@lists.postgresql.org; Wed, 17 Dec 2025 17:24:08 +0000 Received: by mail-oo1-xc35.google.com with SMTP id 006d021491bc7-6579872f00dso3216256eaf.1 for ; Wed, 17 Dec 2025 09:24:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765992247; x=1766597047; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=iEThg6soQ2SFgeOfFxhnq3GwmohVmJjM0yH80ujSeQ4=; b=X4yISW/AIjPz/S/h1xMOAKlWovOpuFmqF9es7JAkk22W6c/tjL8SpTvFHtGwyURVgn ho2z8H/BVadNggnDzfsZckFl2TpYiHlo9riz8rSs2YzgfgRMf2tcc9YkgNT+l1nAXTm/ 5FhpqcFyrdXrqetUV4uF96J4uxWhSxCRl9oA33z3LIdHovCZL1JDrvlAIUMGNtxaiuWQ hTYy5gCoyoT6W5qLNQ8xP8Niit+HAgDzRLDWB/wpYit0XDkbI8/r+ThC3hafIDHxMEDO cTQNeOnZsgZyWA0WBEOLV0bnOhnR5fiuLgJE1kSxW+kmBVJ3qngA2gPAP8X909NaNA2u oL9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765992247; x=1766597047; h=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=iEThg6soQ2SFgeOfFxhnq3GwmohVmJjM0yH80ujSeQ4=; b=Q8/NG2FWnqrBpvNrtemES7oAS8h0gxABIicd3MKuCGwRTPsV8Hch/dPTiw/ztP3/G3 otygTYBN7AYBRiX6rGgxvcKtucdfXFWXwpxpXuhsiuc3/0YVArYYphE/LOAftmWMfw4h xUxhmaq5qZqOcu9SLLE7IijqJrc9E3rF0C4yZCRf0F4IctvoDSCq0/CcQsNUNvM2dBJi ldtT2dd9rgRbS2gZjYkxsxY/9lZkGid+Hki5XZcPKYZ/coPy8vOoR8FBy13RsxLyTnj4 LLWDaUNWW+H8luCBBktLhVd/WesC8Er6hBlXXwryT+H9hV1cmQikxH954JWOZ04rTH6l a/kQ== X-Gm-Message-State: AOJu0YzAE197enjDfYZQVoTMs3WdYDTD/7EI2XL/tRZUofjBEU8Hl+j8 mzzRrN8fftKuzdiGOxotfFmjteQugF2FzsfZxAf4sFTiffL3HlHIWwcCUMVp2j7+hRIctOUSUn3 w9lzQUTMx21V2jLxadJDsJmEaSJBeCz//zKgL5Tc= X-Gm-Gg: AY/fxX6ibXRjoKULGJ7lYNKGcpZ+f7Ddf0FDAW/edsITKVUWuXEkb7vbFmRlOGRB6Re MUDavz3RDGE/+9iwBOLNoFCoV+InSyM0E34qR2v3alDTrnjnVshexIb8vvBEovINcsJnvT7F2+X 5TDj4ncVmTHdmyJIFR1ODN/UP00pyLD/FPWmFl/ZuRUSULVyNmMq6sgTYZeNLjZmeFZlMTxnK/K Tr4nVFm/CMOVamaUejGnNy5huWIpnQVbvxfeR7lIAENxftvQcKaGWgq0tbLkDCtvWplBU3on/Jl EuWfI+dKLvD6e1oOHYs0vGBj4tQ= X-Google-Smtp-Source: AGHT+IH5Ub/BHexh6H2W3XqPJc52YPfUlFWhL59drVbb+/58jNHfNn0HEANdyK5cLB8sjWEY0Nh3dL1O1krbjaVWJUM= X-Received: by 2002:a05:6820:168d:b0:65b:3457:aa8c with SMTP id 006d021491bc7-65b4516c91emr7410701eaf.2.1765992246987; Wed, 17 Dec 2025 09:24:06 -0800 (PST) MIME-Version: 1.0 References: <287E4DF6-35A2-4062-AEBA-32DB1DE35C5D@leisi.net> <8567de96-062f-416a-9d19-f14abfdc925e@gelassene-pferde.biz> In-Reply-To: <8567de96-062f-416a-9d19-f14abfdc925e@gelassene-pferde.biz> From: Greg Sabino Mullane Date: Wed, 17 Dec 2025 12:23:31 -0500 X-Gm-Features: AQt7F2q0gjpBqQuKDl9_C7ZRRT1XeByQfijNnRhZqRwW5Kcte6izBYl0I1jQtzs Message-ID: Subject: Re: Record last SELECT on a row? To: Thiemo Kellner Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000008ed09e0646291c70" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000008ed09e0646291c70 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Dec 17, 2025 at 12:14=E2=80=AFPM Thiemo Kellner wrote: > I wonder whether a view calling a set returning function would be a viabl= e > option. Within the function you execute the actual query twice. Once to > merge selected pk into a protocol table and once for the return of the da= ta > set. > The view would be sucking in the entire table every time . Maybe not a big deal as this is a very tiny table. I think Joe wins this thread with the RLS idea however. Cheers, Greg -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Software Products & Tech Support --0000000000008ed09e0646291c70 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Dec 17, 2025 at 12:14=E2=80=AFPM = Thiemo Kellner <thiemo@ge= lassene-pferde.biz> wrote:
=20 =20 =20
I wonder= whether a view calling a set returning function would be a viable option. = Within the function you execute the actual query twice. Once to merge selec= ted pk into a protocol table and once for the return of the data set.

The view would be sucking in the en= tire table every time . Maybe not a big deal as this is a very tiny table.<= /div>

I think Joe wins this thread with the RLS idea how= ever.


Cheers,
Greg
--
Enterprise= Postgres Software Products & Tech Support

--0000000000008ed09e0646291c70--