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 1tooAA-00Fdkb-QM for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Mar 2025 18:35:43 +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 1tooAB-005IvQ-AM for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Mar 2025 18:35:41 +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 1tooAA-005Iv8-Vr for pgsql-hackers@lists.postgresql.org; Sun, 02 Mar 2025 18:35:41 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tooA6-000ZDr-0J for pgsql-hackers@postgresql.org; Sun, 02 Mar 2025 18:35:41 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-43998deed24so35168255e9.2 for ; Sun, 02 Mar 2025 10:35:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740940538; x=1741545338; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=6SxjUJ6nod+OemlRI+k0656ZeewwA0h2h7IB3RXf5Ko=; b=SLK3TDVGY/nooh3+sZ2smxVQDoEPaQzCNPjLoa1cSgRK8KyMR6kl58zM8xwA1IPY5y byf89ZRCNeF8vaQlpEZwHZxJoyrnTkTtH1HAtJffjokoR8zmd7vNUrW6fB05ZxiV2cOJ t2c2YwDLn2qJ4YlFKNvY/HBlbcGiCTYAZhRycOFYLGNDgo4XY12gY8kNzsp9F+xUr6dy OLuB9IYvieZ6xTsuor9I+lVyE7LvTBE3yB8vcze/sffKVBLtiJCq8v+5A4o5pY3e6fL1 q8mjTYusiO4TMt1h9YohvGJnzkWvIljrgHn31gVzdiMfj1JtZBdeY7I0luGZvYtBIngc pzpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740940538; x=1741545338; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6SxjUJ6nod+OemlRI+k0656ZeewwA0h2h7IB3RXf5Ko=; b=BkEitg4TC0ntYemqvI10q9pFF2Fo/jQNH04fCT5gO6Pq0HRYOo0MKtB2ru0sGKY5W6 uTazhdjh0lrSu1C6id++0GooItpJEsLNxpTV6z83uHT6KiFZRMLvNqOEW2MNnC6l9sM4 gFevkj3I9F/+yLzI/ioz3ULWZqYrDRVJckmZyI9griStlH0wYwMhyyxc3rRRujt30zaC 5phBPTmrjuq7HTklxi1NtIYC4lRpmJ1Ay2UcHzqRwgNJvEazB6HJL/HPIs5T49uu52VQ KaIJFRF2Vpb3Ebcipp/K+k/55nMZ4m0Kst3wz0UKGxCtxT3FPNuAUwl+pCQVNXEnC3HX F2mA== X-Forwarded-Encrypted: i=1; AJvYcCULjXNybhyZExX73wCOUDPMhPyVme5qKVymYLaw1rkZFfz0C0cs8DRo7VNiAVfqdCWkK4d/K7jQkh6P9Ci+@postgresql.org X-Gm-Message-State: AOJu0YxbmbA6HxGmyMnxUDtk1PPZtV9o87397lGMVoSi7EmGH05iXq+O W/Mv/tesoL+bNIG5LVdqPtT9IiUeHRYi2TCwTdIjV8tX4365mwDN X-Gm-Gg: ASbGnctssfs8lpodJG/O83GksoJrlrmrPComR2WlU95oiriB5CV1/Ro13kYj9wlmMpN upty9dKlKRlK4oznOSTRNxx9sOqXYqAj7vb/lfV5xkuh1pqCb8OFjYiLFbrHboI9h7r9RG0R5s8 O1Cc4DOqmXPapudr+6Ic244c38q23ZBiGnj0XOSzwQZE+Ff0Kvpx0td/IG/BwIW9TU20c37PTUK k+Amp+DFD8hUJkvvi5Z7N/9vfyQPT20Ib9R7IkKl+kPis7VaMA6BS/2ceFBlEYIs2LHKrqHi4F3 nRtARUZEoZse9ifuSeDb6LqhFFOOSiKxQGaFPa9pr1C6v/0jBkzmbQ== X-Google-Smtp-Source: AGHT+IEMdsP8uaQIjuIe2IeFtspeJhn+KTTBq32Hau8TIQ0MIx7i/PkYgsyPTvdK8hM0PvYsw/0+Xw== X-Received: by 2002:a05:600c:1547:b0:439:98f6:8bc8 with SMTP id 5b1f17b1804b1-43ba6760ca3mr69611445e9.26.1740940537517; Sun, 02 Mar 2025 10:35:37 -0800 (PST) Received: from [172.20.10.2] ([77.211.4.154]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bc2828afesm6607525e9.9.2025.03.02.10.35.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 02 Mar 2025 10:35:36 -0800 (PST) Message-ID: <2e6681a4-5080-42bf-b930-772a8dec85e5@gmail.com> Date: Sun, 2 Mar 2025 19:35:35 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Add Postgres module info To: Alexander Korotkov Cc: Tom Lane , Yurii Rashkovskii , PostgreSQL-development References: <506788.1733941263@sss.pgh.pa.us> <2c215c98-f713-4c5b-b21a-a4b8fa41890b@gmail.com> <556341.1733967371@sss.pgh.pa.us> <0844622e-9967-409a-8038-470a36f1039c@gmail.com> <8b81a3c0-761f-4cfb-97c6-68819fe4d282@gmail.com> <982748.1734059835@sss.pgh.pa.us> <0e82bf8c-ae70-498d-861e-dba2bb154cad@gmail.com> Content-Language: en-US From: Andrei Lepikhov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 17/2/2025 02:41, Alexander Korotkov wrote: > On Mon, Dec 16, 2024 at 7:02 AM Andrei Lepikhov wrote: >> On 12/13/24 10:17, Tom Lane wrote: >>> There's nothing stopping a field of the magic block from being >>> a "const char *" pointer to a string literal. >> Ok, See v.2 in attachment. > > Generally, the patch looks good to me. I have couple of questions. > > 1) Is it intended to switch all in-core libraries to use PG_MODULE_MAGIC_EXT()? I haven't such intention. Just wanted to demonstrate how it might work. > 2) Once we have module version information, it looks natural to > specify the required version for dependant objects, e.g. SQL-funcions > implemented in shared libraries. For instance, > CREATE FUNCTION ... AS 'MODULE_PATHNAME' LANGUAGE C module_version >= '1.0'; Just to be clear. You want this stuff to let the core manage situations of stale binaries and throw an error like the following: "No function matches the given name, argument types and module version" Do I understand you correctly? It may make sense, but I can't figure out a use case. Could you describe at least one example? -- regards, Andrei Lepikhov