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 1vOFZ8-00Gwol-0A for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Nov 2025 13:28:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vOFZ6-00GZER-25 for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Nov 2025 13:28:12 +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 1vOFZ6-00GZEJ-14 for pgsql-hackers@lists.postgresql.org; Wed, 26 Nov 2025 13:28:12 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vOFZ4-001Zng-0z for pgsql-hackers@postgresql.org; Wed, 26 Nov 2025 13:28:11 +0000 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-b7380f66a8bso1009504166b.2 for ; Wed, 26 Nov 2025 05:28:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1764163688; x=1764768488; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=LThiPZktQ8Wz2Yboo8F4Nxh3/RMrPv5NZZtncxgvGmU=; b=lEjx84NdVUwi67VoWamySI6Nxo6SCBvds573rSCGauG4HiZHLj1ob46mEFb/EAIzBq YceHOhj1BY6qACU6Z9N5ug2kjtuU+0aqdS1VeRk4S9dxQBgnagegUioIz5hGDQYYTsNy cL0x61SttUaDf/1oy6XviEVBVHF3Edu22eHi21qdrEAAwhOYxhKIkex+TAIbhRqdDeSi 94NYEgXi6/W8QHmx+STYxCvVglCa6t8Hb5XAxr6unFQMYLkn0EsiFUapeQ2MpqGI66gF 1ayPj//anZzCEZCMusaN3eT3RBUvQhGDJRReC7qmM1NMAhNcKpFoKxwbj3fuPmifDFZx bGnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764163688; x=1764768488; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LThiPZktQ8Wz2Yboo8F4Nxh3/RMrPv5NZZtncxgvGmU=; b=NZCHLUrhF4Qma65VlMLf+ex0zJeneMN9xjKS+zTzzc0stqh8JCb40rZZA2j0RJ3To7 QeT/AvoDl2NmC23DEGQ5ayNyynlA2LidueH3jxWiZxz+F7N6CIQ9/PuA4rGxC+4CKYrg vFU6dX5efqWpZDSl+19ZYZo2NWkVkU9k7R4gRF5/1dUq4mGBSD+hal4RnZnoJMVyXO6w UwcbPpGLki3GnN8VSHwNnUj0VSV1uOKn5192OIy6sfnhztOqeDx5tZKW4o+ZZ8QsVfqH IwHVvWtOFaqTH8zACiA/u7CYXlPuH/LbBfEeH8JWl9VRDz3DnawpfblJErdf4bH05IBO tk1Q== X-Forwarded-Encrypted: i=1; AJvYcCVOJgazsz4PgXfjwPYmI2xtEsWaDwL509USsIGk1rRFJ85kKInqlMPmL+u2Irpi3ZY9UdT4MoGq5suhCpas@postgresql.org X-Gm-Message-State: AOJu0YylzPi7ho6i0r+A1MVLAlslLokQCiTiU97Aq4zLmhvLALHEcylS ojgi35kUe+jDkWuD49u4NZ+zr5bV8nM6Q2QP/bPQrISwl/JyIc/GVvw6SyctFd4Bbfo= X-Gm-Gg: ASbGncvAcIlMK1J4QPeV1LrAd+RXzySMOSD2bXSz82+GFzWhbXrGXbGgN3IDWlyWx93 LK8ObAZp34llviyX+euyR5ljNlHcXwktGn3xMDrLk6Jwe+FsrpBVgyyZsBV3oPprlpeK25Nr2ky A1gN0GcudZ8T4TFXbDgEJJD88ecV3g8T4pwA9z+7l6lc3wjrlal0+lES6zima0MWoXMfTsYwsZh ZKFZk7wStMgPF7XvgOsinFCk+rCD0aANBuS33szHZ+OJUzCtuZKttlCB3qGE+VLoVxtpbsQ8034 8HNv/CTq8J/tuXeFlJm3Vy6iD0npltkUgFRJORBmREKMGxPcWEq3yPDKjc1cXIX0mxoWEWHChla dlxFnStl49A6wKFayF8iZBIEO52ODgz25XmYvcRRJ2UvNRxCuaACXlrHpEDG9W62S5n7MHgObT4 /eMeKXCx7o92/D7+XdZsxPOls7tFG6k3G/7AhS3qW6 X-Google-Smtp-Source: AGHT+IHnl68yiKs7vax+xOM7AEY9eMEfAGvvVLFjYF6JaL21aiCFdqRJn4/u8HIG6QPtWadV7fKHrg== X-Received: by 2002:a17:907:3e8d:b0:b76:5393:758d with SMTP id a640c23a62f3a-b767170c801mr1853953466b.34.1764163687748; Wed, 26 Nov 2025 05:28:07 -0800 (PST) Received: from laurenz.albe-K4N0CV00F97414D ([88.116.133.170]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6453633fe28sm18060414a12.0.2025.11.26.05.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Nov 2025 05:28:07 -0800 (PST) Message-ID: Subject: Re: System views for versions reporting From: Laurenz Albe To: Dmitry Dolgov <9erthalion6@gmail.com> Cc: Tom Lane , jian he , Joe Conway , pgsql-hackers@postgresql.org Date: Wed, 26 Nov 2025 14:28:06 +0100 In-Reply-To: References: <5jhyl6p3nwcaxczfxuh25q42q6bqlaxyqyfqtw4tldvmm24bw2@rfii5tkwn5rg> <866452.1742768493@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-2.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2025-11-25 at 16:40 +0100, Dmitry Dolgov wrote: > Here is the updated patch. Thanks for the updated patch. Comments: You didn't address any of my suggestions concerning the documentation, except that you moved the entry in "System Views" to the correct place. The second patch contains: > +void > +jit_register_version(void) > +{ > + add_system_version("LLVM", jit_get_version, RunTime); > +} But that belongs into the third patch. +/* + * Callback for add_system_version, returns JIT provider's version string = and + * reports if it's not available. + */ +const char * +jit_get_version(bool *available) +{ + const char *version; + + if (!provider_init()) + { + *available =3D false; + return ""; + } + + version =3D provider.get_version(); + + if (version =3D=3D NULL) + { + *available =3D false; + return ""; + } + + *available =3D true; + return version; +} Perhaps more elegant would be: if (provider_init()) { version =3D provider.get_version(); if (version) { *available =3D true; return version; } } *available =3D false; return ""; Other than that, it looks fine. Yours, Laurenz Albe