Re: improve CREATE EXTENSION error message - Mailing list pgsql-hackers

From Chapman Flack
Subject Re: improve CREATE EXTENSION error message
Date
Msg-id 61A56641.8060207@anastigmatix.net
Whole thread Raw
In response to Re: improve CREATE EXTENSION error message  ("Bossart, Nathan" <bossartn@amazon.com>)
Responses Re: improve CREATE EXTENSION error message
List pgsql-hackers
On 11/29/21 17:54, Bossart, Nathan wrote:

>         postgres=# CREATE EXTENSION does_not_exist;
>         ERROR:  extension "does_not_exist" is not available
>         DETAIL:  Extension control file "/usr/local/pgsql/share/extension/does_not_exist.control" does not exist.
>         HINT:  The extension must first be installed on the system where PostgreSQL is running.

That looks like the direction I would have gone with it.

I wonder, though, is it better to write "does not exist." in the message,
or to use %m and get the exact message from the OS (which presumably would
be "No such file or directory" on Unix, and whatever Windows says for such
things on Windows).

My leaning is generally to use %m and therefore the exact OS message
in the detail, but I don't claim to speak for the project style on that.

Regards,
-Chap



pgsql-hackers by date:

Previous
From: Greg Nancarrow
Date:
Subject: Re: Correct handling of blank/commented lines in PSQL interactive-mode history
Next
From: Alvaro Herrera
Date:
Subject: Re: Correct handling of blank/commented lines in PSQL interactive-mode history