Re: improve CREATE EXTENSION error message

Nathan Bossart <bossartn@amazon.com>

From: "Bossart, Nathan" <bossartn@amazon.com>
To: Tom Lane <tgl@sss.pgh.pa.us>, Daniel Gustafsson <daniel@yesql.se>
Cc: Chapman Flack <chap@anastigmatix.net>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2021-11-29T22:18:48Z
Lists: pgsql-hackers
On 11/29/21, 2:13 PM, "Bossart, Nathan" <bossartn@amazon.com> wrote:
> Alright, here's v3.  In this version, I actually removed the message
> about the control file entirely, so now the error message looks like
> this:
>
>         postgres=# CREATE EXTENSION does_not_exist;
>         ERROR:  extension "does_not_exist" is not available
>         DETAIL:  The extension must first be installed on the system where PostgreSQL is running.
>         HINT:  The pg_available_extensions view lists the extensions that are available for installation.
>
> I can add the control file part back if we think it's necessary.

Hm.  I should probably adjust the hint to avoid confusion from
"installed on the system" and "available for installation."  Maybe
something like

        The pg_available_extensions view lists the available extensions.

Nathan

Commits

  1. Improve error message for missing extension.