Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pZKLc-0007m3-PY for pgsql-interfaces@arkaria.postgresql.org; Mon, 06 Mar 2023 23:34:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pZKLb-00074q-Ei for pgsql-interfaces@arkaria.postgresql.org; Mon, 06 Mar 2023 23:34:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pZKLb-00074c-5A for pgsql-interfaces@lists.postgresql.org; Mon, 06 Mar 2023 23:34:27 +0000 Received: from mail-vs1-xe2f.google.com ([2607:f8b0:4864:20::e2f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pZKLY-00064W-AA for pgsql-interfaces@lists.postgresql.org; Mon, 06 Mar 2023 23:34:26 +0000 Received: by mail-vs1-xe2f.google.com with SMTP id f23so10778432vsa.13 for ; Mon, 06 Mar 2023 15:34:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678145662; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XeWDRBYLlCuLEmwmjwUawa28PsRNOtzStnfUi+wXFhU=; b=V2yJzeKXKz5MBmhAAjwYEFHWChfh9XHb4jbYabNP6mi/4QYdltczdpqPEtOkzy8h1l brL9M7Puq6P71HMEY9FL7WwELgArSSfN2U83h+ghkcXHXwPOjTEZGr30PzRdbLN+yYVt mVDps6YP/0z+PKzJTcQWu3C/0WZsG7057knjUPCqs0reQZEAvBUFHdHMVimRizKv5qVd fPMjkBls4JJypdo77JH97KITfJaAtloV4T/bMoRo5TuwBtGQLSv5xq1LmabnrI43OAhQ S6kZrNanRglPcwBuGpf2MkbThCyaA/Khyue7z6d2pRPitqmMers/UhhHeNNeGjapu2/n Pi+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678145662; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XeWDRBYLlCuLEmwmjwUawa28PsRNOtzStnfUi+wXFhU=; b=DNv3rUS/R8gzRx6ivTctJHPIUV/XkvFymmNkzqrsOqA1I+ZkUtyk30Es52O/n7hkTk KyTS5tNgeD0MzidwwDFN5NSS81f5fcV/33paE9X4Na/IztGoivwUX6lILb9ZoRu9GjP2 M68zNIWTdO7S0I1hU9UqZNy/hhVLZ+v7cl6zVBrh3mdpCOFtcpTKEnECDqTcuQmxilph G9P6n0JD6US6tucmbua6jyZ4/4dwnPtIMasf1Gz44bP7BotFKRVWVuFQ43ZO6MhKGExa tsauPU9+uDKV1UwY5tY/AJJ5NBzv2H59b1+nBBmQLFyVmZL7/spjQS3swtCwTU5FwYha gu6A== X-Gm-Message-State: AO0yUKV4o3XcOGnmZhxcuimHOnSMsfNLnOtYO76OsCg2uKJPyfKrrmam JxWzOp3rpj5/sJRt57G53es/yKIu1PwFgDzWjJ4= X-Google-Smtp-Source: AK7set/NggTvt2s6XvqFEnrutpBPdnl9v4na3XZmyXloOL7MMOsYYG7YHuhJrZ107vF8gaBoyP1FVg/PGnlykxObjhw= X-Received: by 2002:a67:d086:0:b0:411:fd99:bc47 with SMTP id s6-20020a67d086000000b00411fd99bc47mr7836924vsi.2.1678145661704; Mon, 06 Mar 2023 15:34:21 -0800 (PST) MIME-Version: 1.0 References: <3352436.1678116090@sss.pgh.pa.us> In-Reply-To: <3352436.1678116090@sss.pgh.pa.us> From: Flaris Feller Date: Mon, 6 Mar 2023 20:33:45 -0300 Message-ID: Subject: Re: Transaction control in a C language function To: Tom Lane Cc: pgsql-interfaces@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000000c1ff105f643bcad" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000000c1ff105f643bcad Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Tom, You are absolutely right, I was calling it from a function instead of a procedure. The documentation should mention that. Thanks for your clarification. Regards, Flaris. Em seg., 6 de mar. de 2023 =C3=A0s 12:21, Tom Lane escr= eveu: > Flaris Feller writes: > > I would like to implement transaction control in a function implemented > in > > C language. > > That will certainly not work unless you make it a procedure. > It'd be a good idea also to check that the CALL came from a > non-atomic context. > > regards, tom lane > --=20 Flaris Roland Feller https://www.linkedin.com/in/flarisfeller --0000000000000c1ff105f643bcad Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello Tom,
You are absolutely right, I was = calling it from a function instead of a procedure.
The documentat= ion should mention that.
Thanks for your clarification.
=
Regards,
Flaris.

Em seg., 6 de mar. de 2023 =C3=A0s= 12:21, Tom Lane <tgl@sss.pgh.pa.us= > escreveu:
Flaris Feller <flaris.feller@gmail.com> writes:
> I would like to implement transaction control in a function implemente= d in
> C language.

That will certainly not work unless you make it a procedure.
It'd be a good idea also to check that the CALL came from a
non-atomic context.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 regards, tom lane


--
--0000000000000c1ff105f643bcad--