From rocampos@bry-it.com Tue Jan 16 12:15:43 2024 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 1rPivP-00DfBz-UJ for pgsql-general@arkaria.postgresql.org; Tue, 16 Jan 2024 12:52:16 +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 1rPivO-003k5N-Uk for pgsql-general@arkaria.postgresql.org; Tue, 16 Jan 2024 12:52:14 +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 1rPiMA-003YWk-4N for pgsql-general@lists.postgresql.org; Tue, 16 Jan 2024 12:15:50 +0000 Received: from lvps91-250-99-172.dedicated.hosteurope.de ([91.250.99.172]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rPiM7-00270Q-Fc for pgsql-general@lists.postgresql.org; Tue, 16 Jan 2024 12:15:49 +0000 Received: from HAPPIX (bry-it.net [37.24.105.49]) by lvps91-250-99-172.dedicated.hosteurope.de (Postfix) with ESMTPSA id A08B9FA92D for ; Tue, 16 Jan 2024 13:15:43 +0100 (CET) From: "Rossana Ocampos" To: Subject: Nested-Internal Functions Date: Tue, 16 Jan 2024 13:15:43 +0100 Message-ID: <00d201da4875$ba6c8aa0$2f459fe0$@bry-it.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00D3_01DA487E.1C33B1C0" X-Mailer: Microsoft Outlook 14.0 Thread-Index: AdpIdauD3QAaKPKoTeOZ+1xey2D+og== Content-Language: de List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multipart message in MIME format. ------=_NextPart_000_00D3_01DA487E.1C33B1C0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello , I have a query about creating nested functions in PostgreSQL. I am currently using PostgreSQL 15 and I am trying to create a nested function with the following structure: CREATE OR REPLACE FUNCTION external_function () RETURNS void AS $$ DECLARE external_variable; -- Define the internal function FUNCTION internal_function () RETURNS void AS $$ DECLARE internal_variable INT; BEGIN -- Internal function code internal_variable:= 10; RAISE NOTICE 'Internal Variable: %', internal_variable; END; $$ LANGUAGE plpgsql; BEGIN -- External function code external_variable:= 5; RAISE NOTICE 'External variable: %', external_variable; -- Call internal function PERFORM internal_function (); END; $$ LANGUAGE plpgsql; However, I get an error, and I can't compile the function. Thank you very much for your help Rossana Ocampos ------=_NextPart_000_00D3_01DA487E.1C33B1C0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello ,

I have a query about creating = nested functions in PostgreSQL.

I am currently using PostgreSQL = 15 and I am trying to create a nested function with the following = structure:

CREATE OR REPLACE FUNCTION external_function = ()

RETURNS void AS $$

DECLARE

external_variable;

    =

    -- Define the internal = function

    FUNCTION internal_function = ()

    RETURNS void AS = $$

    DECLARE

        = internal_variable INT;

    = BEGIN

        -- Internal = function code

        = internal_variable:=3D 10;

        RAISE NOTICE = 'Internal Variable: %', internal_variable;

    = END;

    $$ LANGUAGE = plpgsql;

BEGIN

    -- External = function code

    external_variable:=3D = 5;

    RAISE NOTICE 'External variable: %', = external_variable;

 

    -- Call = internal function

    PERFORM internal_function = ();

END;

$$ LANGUAGE plpgsql;

 

However, I get = an error, and I can't compile the function.

Thank you very much for your = help

Rossana Ocampos =

------=_NextPart_000_00D3_01DA487E.1C33B1C0-- From david.g.johnston@gmail.com Tue Jan 16 13:24:49 2024 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 1rPjR1-00Dk10-B4 for pgsql-general@arkaria.postgresql.org; Tue, 16 Jan 2024 13:24:55 +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 1rPjQz-0041cR-H5 for pgsql-general@arkaria.postgresql.org; Tue, 16 Jan 2024 13:24:53 +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.94.2) (envelope-from ) id 1rPjQz-0041cJ-2g for pgsql-general@lists.postgresql.org; Tue, 16 Jan 2024 13:24:53 +0000 Received: from mail-oa1-x34.google.com ([2001:4860:4864:20::34]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rPjQw-001omc-Q5 for pgsql-general@lists.postgresql.org; Tue, 16 Jan 2024 13:24:51 +0000 Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-2043e721daaso6302841fac.2 for ; Tue, 16 Jan 2024 05:24:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705411490; x=1706016290; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=9jEr5cve+JY0wN6QJrgpS9RVAAwLbjWh5mgP7Je+D9c=; b=FnCgEViA4UL0kkJRfnpfZz1Id3Goom9I1hdaaqGTw0+hMbgRtQkjZgw+vRHDXxhOaY 7xp3N62gJye+RPAqNQNmUeEf0DOQl2ARSsPP0YEV80ERvFBe5tTki758qsGwRje961rQ zdm+HiTv+Ybm5qjwFjnsUNCaxOzP3Vnbckyl5b92taRfSN4fRSCopeVfjfOeR6AUohbE 8IXyT3VBgxvbeZeLNHcD9NBDlD3R5enPVaPIPLzXmnnuGzgO2K2BLfbNu/SIPxQUnU1F f2wo3LxXeMRLSqUK87pJBqUVbv+GBlhRuwYgowBzvxA4Auzx0qeF56lugSTLOTVGV5qq TeTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705411490; x=1706016290; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9jEr5cve+JY0wN6QJrgpS9RVAAwLbjWh5mgP7Je+D9c=; b=Gfq2+K1kSNBYNbvbI8opxJiiU6S24BUaAuwhRvokNDLWNgIHke16PGLK/yhMxyBT5h hdZ26RkYf7fsJUMelbo33MftI/7UjQtOYlcIv/MGtO17gQkP1FS7xP69NFNH42J4f+WI 6/ZVo1mwZmqyKFDAOH7J/ccj8EG1MOjSUT1CCtsy2T2yx+Js9ir0sEkAve1mB66MoHD+ Emj069vFpsHNj/LCi0ThEmhQAAHs1IedgWfyZc1VQ2kAjplrdocDOt5VDh4Rq4wkekaI KPze4ixgkAjASR/C6nVjAzvGIXp7F8TtTVpAhzKoy4olwWPXMcPf24VkZn0aXmfsQpxG Be+A== X-Gm-Message-State: AOJu0Yw6XUW42NlHAWY7UOn/uNCXTEV5iw1tOnKUlkqypm5NU+90JW// VNZjMwvq6hpLHgznKj7H1ons06JVV/6K0yhhUN09xbUP X-Google-Smtp-Source: AGHT+IGLwIvufaPVtP46vvNzCwUH9ho87LQijMMmXNnddpR9/0Uy0NqoqkCsq48lti2210yuAA4O22u82xtyFSvSKVY= X-Received: by 2002:a05:6870:8091:b0:206:7840:48d0 with SMTP id q17-20020a056870809100b00206784048d0mr9148011oab.117.1705411490054; Tue, 16 Jan 2024 05:24:50 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ac9:5ed1:0:b0:513:5b48:4077 with HTTP; Tue, 16 Jan 2024 05:24:49 -0800 (PST) In-Reply-To: <00d201da4875$ba6c8aa0$2f459fe0$@bry-it.com> References: <00d201da4875$ba6c8aa0$2f459fe0$@bry-it.com> From: "David G. Johnston" Date: Tue, 16 Jan 2024 06:24:49 -0700 Message-ID: Subject: Re: Nested-Internal Functions To: Rossana Ocampos Cc: "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000000f8859060f100e32" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000000f8859060f100e32 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tuesday, January 16, 2024, Rossana Ocampos wrote: > *Hello ,* > > *I have a query about creating nested functions in PostgreSQL.* > > *I am currently using PostgreSQL 15 and I am trying to create a nested > function with the following structure:* > > *CREATE OR REPLACE FUNCTION external_function ()* > > *RETURNS void AS $$* > > *DECLARE* > > *external_variable;* > > > > * -- Define the internal function* > > * FUNCTION internal_function ()* > > * RETURNS void AS $$* > > * DECLARE* > > * internal_variable INT;* > > * BEGIN* > > * -- Internal function code* > > * internal_variable:=3D 10;* > > * RAISE NOTICE 'Internal Variable: %', internal_variable;* > > * END;* > > * $$ LANGUAGE plpgsql;* > > *BEGIN* > > * -- External function code* > > * external_variable:=3D 5;* > > * RAISE NOTICE 'External variable: %', external_variable;* > > > > * -- Call internal function* > > * PERFORM internal_function ();* > > *END;* > > *$$ LANGUAGE plpgsql;* > > > > However, I get an error, and I can't compile the function. > > *Thank you very much for your help* > > You did nested dollar quoting wrong; and I don=E2=80=99t see the word creat= e where you try to define the function inside the outer function. You are probably better off just defining two functions independently anyway, there is minimal benefit to having on function define another in PostgreSQL, there are no closures. David J. --0000000000000f8859060f100e32 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tuesday, January 16, 2024, Rossana Ocampos <rocampos@bry-it.com> wrote:

Hello ,

I have a query about creating nested fu= nctions in PostgreSQL.

<= b>I am currently using PostgreSQL 15 and I am trying t= o create a nested function with the following structure:

CREATE OR REPLACE = FUNCTION external_function ()

RETURNS void AS $$

DECLARE

external_variable;=

=C2=A0=C2=A0=C2=A0

= =C2=A0=C2=A0=C2=A0=C2=A0-- Define the internal functio= n

=C2=A0=C2=A0=C2=A0 FUNCTION internal_function ()=

=C2=A0=C2=A0=C2=A0 RETUR= NS void AS $$

=C2=A0=C2=A0=C2=A0 DECLARE

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 internal_variable INT;

=C2=A0=C2=A0=C2=A0 BEGIN

=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 -- Internal function code<= /b>

=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 internal_variable:=3D 10;

=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 RAISE NOTICE 'Internal Variable: %', internal_varia= ble;

=C2=A0=C2=A0=C2=A0 END;

=C2=A0=C2=A0=C2=A0 $$ LANGUAGE plpgsql;=

BEGIN<= u>

= =C2=A0=C2=A0=C2=A0 -- External function code

=C2=A0=C2=A0=C2=A0 external_va= riable:=3D 5;

=C2=A0=C2=A0=C2=A0 RAISE NOTICE 'External variable: %'= ;, external_variable;

=C2=A0

=C2=A0=C2=A0=C2=A0 -- Call internal function

= =C2=A0=C2=A0=C2=A0 PERFORM internal_function ();

END;<= /b>

$$ LANGUAGE plpgsql;<= u>

= =C2=A0

However, I get an error, and I can't compile the function.=

Thank you = very much for your help


You did nested dollar quoting wrong; an= d I don=E2=80=99t see the word create where you try to define the function = inside the outer function.

You are probably better= off just defining two functions independently anyway, there is minimal ben= efit to having on function define another in PostgreSQL, there are no closu= res.

David J.
=C2=A0
--0000000000000f8859060f100e32-- From laurenz.albe@cybertec.at Tue Jan 16 14:41:47 2024 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 1rPkdX-00Dsrt-2Y for pgsql-general@arkaria.postgresql.org; Tue, 16 Jan 2024 14:41:55 +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 1rPkdV-004NPC-Vi for pgsql-general@arkaria.postgresql.org; Tue, 16 Jan 2024 14:41:53 +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.94.2) (envelope-from ) id 1rPkdV-004NP4-Gy for pgsql-general@lists.postgresql.org; Tue, 16 Jan 2024 14:41:53 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rPkdS-001pQQ-S4 for pgsql-general@lists.postgresql.org; Tue, 16 Jan 2024 14:41:52 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3376ead25e1so7816739f8f.3 for ; Tue, 16 Jan 2024 06:41:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20230601.gappssmtp.com; s=20230601; t=1705416108; x=1706020908; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:to:from:subject:message-id:from:to:cc :subject:date:message-id:reply-to; bh=TKkjO7hcvwn9q80qZc4ZxGMUWyfmFdcnxWCJGcEqis8=; b=o4kKurF/6Btq/6IG0bH9hPBMrBr9fcA2iBKg6Q38RbndXlLF3sPVpFiwEc2DSQQQdo 5FrVGrx3LzIo95RG2dqhdrzyk918Llqkd3r0q53e46L7GZDZ3qYctTmuV5PpfWM2hgq5 GM0CrQYSRcWJdLyjDY4D4fvDHL2n3cIXUTfci9KREntH0KYr8YHgJaHomuFgK5CPb1AP UFaUAAR+7Ap8mQMboajKY9L9qdq+aInxLRF3pKPvQ2xpXglDhMxEt/NcJUjhnIXe5ed8 OxhUbi1EiBUtl4FfGLOPILEU1r4JCPtf1o9Oa84TrkiDOeD9hB9yTq4TN/R6L4p/H57F o2YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705416108; x=1706020908; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:to:from:subject:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TKkjO7hcvwn9q80qZc4ZxGMUWyfmFdcnxWCJGcEqis8=; b=ADEfcM+n2fMJw7Ts4+C6j75xb5PEt2kxgiUQflqEsV3JdUHT1o3B95dv7rj/M3qLnK SQLS4FG2MrKOOSxfb6l/vwN41IC/Jy9kePNbnKnjXoI+ERp8SmTLYqOAAukaV34cRYOF PF4t53OQUzUWsqfGpyhmRW5Ru9IcU44bK1/23e1CLHRWKdcpgOYAYpKPzwNPaizqwydL vhzrezZI0mmQ/cZBKkdRY0Y3YkHupkCdS9QtMgWAp+r+cZsi+a3Y9ja9WC5GwOVd0QKR OxhLjPrR81VqKRbapQ4v5RxbpbYcLAcDD/y08o0hrqcYQSd5zl2JBQYbRE0qvxiGny6d Vu+g== X-Gm-Message-State: AOJu0YxruB6M7Qspp5Gub+PDgb6DeCaBTU4ecTm1/UywkP2683SgtOMs nLhRlXWJrQDI5BMvovVIp9BmG6+tZ49De+/a3wtSP/yG0Ao= X-Google-Smtp-Source: AGHT+IFv8ou5I8ZjyMc5LmSG/AtNX2LA/OQUBKOlrblp7McRxPvuTJhNsWjb6uBVePHWw+kWZUbJNA== X-Received: by 2002:adf:a441:0:b0:336:7957:8c64 with SMTP id e1-20020adfa441000000b0033679578c64mr4069693wra.139.1705416108300; Tue, 16 Jan 2024 06:41:48 -0800 (PST) Received: from localhost.localdomain ([2001:871:260:cfcc:eecc:72cd:de28:1a94]) by smtp.gmail.com with ESMTPSA id q28-20020adfab1c000000b003372b8ab19asm14876054wrc.64.2024.01.16.06.41.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 06:41:48 -0800 (PST) Message-ID: Subject: Re: Nested-Internal Functions From: Laurenz Albe To: Rossana Ocampos , pgsql-general@lists.postgresql.org Date: Tue, 16 Jan 2024 15:41:47 +0100 In-Reply-To: <00d201da4875$ba6c8aa0$2f459fe0$@bry-it.com> References: <00d201da4875$ba6c8aa0$2f459fe0$@bry-it.com> Autocrypt: addr=laurenz.albe@cybertec.at; prefer-encrypt=mutual; keydata=mQINBGGDwAQBEADgbWy5cKXQld3N2mF+DFyiNFbi2oBl2T+XgxpPF8wTRw2D/u4bBKXP0SYSE/lA86jIVNWWU0gf1KODIkVvgJm2w4vH2VBV1b7ddVViGl1Iu+9zaRnv9wulhnH42KefepXnoean6UT1EzLM0opF/Ik0j+40TxdRtobkBprkQUyHDXWlHc2ffPs3SipyFEP9AVLf7ejRC46CXWDnsqjOBSMEW8Z4HiK/8RrPZBsKLts8dJxKF4pygOdJb0CWk8k/X1jbcfdxo+zOLjOMvJcSJ2pFdJmQHU+JufB3rePziqQ2S9Ur6sccr9XnTC1GVBWN4Lf5VHq+vf+bFJjVwg+2hrySZnAVfcOrxoqFLErr7ug1zN2nM1kcpgA4VWn4gxlJtYNYYq+9WxX5dtvnNANlG3ZCrRKQzl8lxtzoF6Zo7LUhEqPaHDwn7Rvs+IdbOn41lF5UDTJGqmC4gS/bZydW2Fy3YWm4aSaN9fgFf8D+PVkrlKAZB7gBLz1TyHjbcRf85cYF+GKKrDld5SzMB/V60VX3oP/Eo8ikFpyWaqiz1f9X7MBot3/PjJkY+wDzp3nmb19QEcOBuQiSQ4xds2r0HewbuHTAR68u8jNNMGmpm2j4x+g09Jd/WQDjqlTBZ/jEltH41fYCCPWMfljXTOOXu2eLNGdfi7ETZogtwjM9oTtSPQARAQABtCdMYXVyZW56IEFsYmUgPGxhdXJlbnouYWxiZUBjeWJlcnRlYy5hdD6JAk4EEwEIADgWIQR0CqhbZGGABqoaSbdi8bhXA2EdmAUCYYPABAIb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CidZ8F9/D3bWAl4rjtHlsztN59 +AnW5l0HsQcY9ntFL/zEBOaonjdJf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.3 (3.50.3-1.fc39) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2024-01-16 at 13:15 +0100, Rossana Ocampos wrote: > I have a query about creating nested functions in PostgreSQL. There are no "nested functions" in PostgreSQL. You'd need to rewrite that to use a proper stand-alone function. Yours, Laurenz Albe From pavel.stehule@gmail.com Thu Jan 18 12:34:56 2024 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 1rQRcQ-001JBw-8q for pgsql-general@arkaria.postgresql.org; Thu, 18 Jan 2024 12:35:38 +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 1rQRcP-002MJx-Eg for pgsql-general@arkaria.postgresql.org; Thu, 18 Jan 2024 12:35:37 +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.94.2) (envelope-from ) id 1rQRcP-002MJo-1q for pgsql-general@lists.postgresql.org; Thu, 18 Jan 2024 12:35:37 +0000 Received: from mail-yw1-x112d.google.com ([2607:f8b0:4864:20::112d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rQRcM-0029Se-J7 for pgsql-general@lists.postgresql.org; Thu, 18 Jan 2024 12:35:35 +0000 Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-5f2d4aaa2fdso125125557b3.1 for ; Thu, 18 Jan 2024 04:35:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705581334; x=1706186134; 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=JJqLrShuTtVsHb9lkBkyYqVGTqgKNewd4f7mf5s3VNQ=; b=G7xIL50YidF3vFTlTRCLzbPICsz0Kx9iFnRO9GEJUFQDd0iWzzYrHM3vd3gxQBukXD Itwt965LSjtcrVMH355BJiaDJ4nPEfUz5kwhyKJjP9+adwv6QhqKpBQEl42Kh53EsTtC 0wFeOCnvzbA5nrjeYPIfQtHW+bKmjU2pBBSFMZQpuiz2KcEBBwptMmRFd6fETIk8gQEA huPMoP2o4BeEfCLPqAG05/q+fEUFDG7lEv/nKvPkTDH1LcIAQ6+Z3A5g/HADZQ2reZx8 7fSEepznz8kaTCxCICBwJPeFZzXVU5BSe12uF12w8nD+od3QT+JiGBLFxVNzijAvbAAS qp2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705581334; x=1706186134; 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=JJqLrShuTtVsHb9lkBkyYqVGTqgKNewd4f7mf5s3VNQ=; b=KyNq2TDlg0EWCORZgUNObSJEBxHoif5RweBpdh/U2AP4cTOjVquHj8a/KIrB5KGr5A rCAeMCeEN7ffMsOagkrQ+Naal75eW+3SUqxXC/hZZpJWTqlU3YyaSUqeI1atXjybn+Jc BIbAhCyTzC8jZwNLa9BBMZLt+AXOIGBVcxgjVB69UPBOdXe8ah3y+Im21C9BWK05s+ot kjuYVhIvuY1NykZkjSLmmXpoAIlovUVEW9fXpqtTDb2pf3ErkME5hRpeS6Oo2ayMY33Z /ubZblzImVtrw+ueLRIMGizlkXtJc7i5h8jb6K7hZrNxk8QoHFoaAHBhjRdsIpwx2WqG VJxg== X-Gm-Message-State: AOJu0Yy9Syn6lINh467pXqXcEi8Z5kIeEDhFjGGQLjwBzu7AgLesuzIG NaemD13eNsnb60ho5TobZlcpMFQEewYZZfrRwl4IyhAz1OnxXQuGcHV2PrBbWZZblaeonSvnbhn wr5xAda3WzPniio3utc/Tuir1Mao= X-Google-Smtp-Source: AGHT+IF8myzMsLzsJ7hceVQGxobd2AXWmkVjldbUeal6tEUu9QvzFp5iGYzm36B2KrqQscLDidCFCUvE0Axr1fdXS34= X-Received: by 2002:a25:e04e:0:b0:dc2:27ec:aca5 with SMTP id x75-20020a25e04e000000b00dc227ecaca5mr566707ybg.78.1705581333561; Thu, 18 Jan 2024 04:35:33 -0800 (PST) MIME-Version: 1.0 References: <00d201da4875$ba6c8aa0$2f459fe0$@bry-it.com> <010201da49ea$eac25470$c046fd50$@bry-it.com> In-Reply-To: <010201da49ea$eac25470$c046fd50$@bry-it.com> From: Pavel Stehule Date: Thu, 18 Jan 2024 13:34:56 +0100 Message-ID: Subject: Re: Nested-Internal Functions To: Rossana Ocampos Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000085c7b4060f3799b7" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000085c7b4060f3799b7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi =C4=8Dt 18. 1. 2024 v 13:31 odes=C3=ADlatel Rossana Ocampos napsal: > Effectively I had to create the function externally, I am in the process > of migrating from Oracle to Postgresql and I have many cases of > encapsulated functions and transactions. > Thank you very much for the return. > Rossana Ocampos > There is not any help or possibility - this Oracle's functionality is not supported ever. There is not any workaround. Regards Pavel > -----Urspr=C3=BCngliche Nachricht----- > Von: Laurenz Albe [mailto:laurenz.albe@cybertec.at] > Gesendet: Dienstag, 16. Januar 2024 15:42 > An: Rossana Ocampos; pgsql-general@lists.postgresql.org > Betreff: Re: Nested-Internal Functions > > On Tue, 2024-01-16 at 13:15 +0100, Rossana Ocampos wrote: > > I have a query about creating nested functions in PostgreSQL. > > There are no "nested functions" in PostgreSQL. > You'd need to rewrite that to use a proper stand-alone function. > > Yours, > Laurenz Albe > > > > --00000000000085c7b4060f3799b7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

=C4=8Dt 18. 1. 2024 v=C2=A013:31 odes=C3=ADla= tel Rossana Ocampos <rocampos@bry= -it.com> napsal:
Effectively I had to create the function externally, I am in the pr= ocess of migrating from Oracle to Postgresql and I have many cases of encap= sulated functions and transactions.
Thank you very much for the return.
Rossana Ocampos

There is not any help o= r possibility - this Oracle's functionality is not supported ever. Ther= e is not any workaround.

Regards
Pavel


-----Urspr=C3=BCngliche Nachricht-----
Von: Laurenz Albe [mailto:laurenz.albe@cybertec.at]
Gesendet: Dienstag, 16. Januar 2024 15:42
An: Rossana Ocampos; pgsql-general@lists.postgresql.org
Betreff: Re: Nested-Internal Functions

On Tue, 2024-01-16 at 13:15 +0100, Rossana Ocampos wrote:
> I have a query about creating nested functions in PostgreSQL.

There are no "nested functions" in PostgreSQL.
You'd need to rewrite that to use a proper stand-alone function.

Yours,
Laurenz Albe



--00000000000085c7b4060f3799b7--