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 1njVRm-0005ff-DT for pgsql-general@arkaria.postgresql.org; Wed, 27 Apr 2022 00:22:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1njVRl-00063u-0p for pgsql-general@arkaria.postgresql.org; Wed, 27 Apr 2022 00:22:21 +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 1njVRk-00063l-LY for pgsql-general@lists.postgresql.org; Wed, 27 Apr 2022 00:22:20 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1njVRh-0000XM-JY for pgsql-general@lists.postgresql.org; Wed, 27 Apr 2022 00:22:20 +0000 Received: by mail-pj1-x1029.google.com with SMTP id fv2so57176pjb.4 for ; Tue, 26 Apr 2022 17:22:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yugabyte.com; s=google; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=ZvXDEN0SkGK7HIwGLJYRSeankxWrxOjeyQWo8vxGKOs=; b=OHWPBf+OdXmjrpfLwOnN9UKAk3xMGVK2rHV2VsogFqUvRdpP2XIuINbjQ02TwAUWnA kAIgvpSRUy9Ur3W7Wqfr9fMOF/A9QefQK8ymo7sTYanUdAdFgYvdip4eTY9hh3Uj0d2q gIHhdYN7yqyKmvc1jUXObu8kLCtiagiDrXfTI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=ZvXDEN0SkGK7HIwGLJYRSeankxWrxOjeyQWo8vxGKOs=; b=lZ9gyzdrpNKbw/VNWtWLhDOMVhJ1xSwvU7kBIWtQmlDEM+sJsdMq4n/nxvzhLgrgl8 W0fD+1drAqTs6Gyje+UjgrqJo8jvg6Qg7MUkhfZqxyR8SptUR2TNsh3ZFnLLG+DRy0QW N1DWE1OWfFuDC4oUSPI4d1MvgiKROvAndmmjbIu48DSn9hegdKDLG6xd5n8b7nHmNdCi K+rNbyGIF3digf1TqYYwHEJMGF7fM4nqjT3q09UYB/eiKfMtvC3wc68A2TYJDm7zqbtf FrcBTzWkgBThYbWn0VnCgl2NgL0moNiogtbNnthDhMucrH5ywqiDJad1P4pGwJWJK03h 4lIA== X-Gm-Message-State: AOAM531eAb93n6dwS1Vuv4361DzwRYyBFM7sH9Vz4erzPrraCgzBTcpX oGCZxMfpGjxDUgmTabEm+r+FZoDLazaM5A== X-Google-Smtp-Source: ABdhPJz1ZxD+imG0w8jC7m8XeY8ne6oFyQGRIf7ud2yYeXez/1Z8ePUwwLI2cqioY1Z22HGw3M9nPw== X-Received: by 2002:a17:902:9041:b0:159:e08:5f4b with SMTP id w1-20020a170902904100b001590e085f4bmr25844708plz.33.1651018934861; Tue, 26 Apr 2022 17:22:14 -0700 (PDT) Received: from smtpclient.apple ([2601:646:101:7fda:44c9:7f6:4013:3da6]) by smtp.gmail.com with ESMTPSA id n14-20020a17090a394e00b001d5f22845bdsm4829351pjf.1.2022.04.26.17.22.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Apr 2022 17:22:14 -0700 (PDT) From: Bryn Llewellyn Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: "create function... depends on extension..." not supported. Why? Message-Id: Date: Tue, 26 Apr 2022 17:22:12 -0700 To: pgsql-general list X-Mailer: Apple Mail (2.3654.120.0.1.13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Note: I=E2=80=99m asking because the answer to the question =E2=80=9CWhy = isn=E2=80=99t X supported?=E2=80=9D is always useful. For example, if = supporting it would imply a logical impossibility that I=E2=80=99m too = slow to spot, it helps me when someone explains what I failed to = realize. Equally, it helps me to know when the answer is =E2=80=9CIt=E2=80= =99s just a historical accident. It could have been supported. But, now = that it isn=E2=80=99t, it doesn=E2=80=99t seem worth the effort to = bridge that gap=E2=80=9D because this shows me that my existing mental = model is sound. The background for my question here is that among the documented changes = that you can make using =E2=80=9Calter function=E2=80=9D https://www.postgresql.org/docs/current/sql-alterfunction.html you can specify all of them at =E2=80=9Ccreate time=E2=80=9D too (but = possibly, like =E2=80=9Cowner=E2=80=9D, only implicitly) except for = =E2=80=9Cdepends on extension=E2=80=9D. When you know in advance that = you want to set this property, you need two statements: create function f() returns int language plpgsql as $body$ begin return 42; end; $body$; alter function f() depends on extension pgcrypto; Why is this not supported: create function f() returns int language plpgsql depends on extension pgcrypto as $body$ begin return 42; end; $body$;