Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6f6943f

Browse files
committed
Improve error message for missing extension.
If we get ENOENT while trying to read an extension control file,report that as a missing extension (with a HINT to install it)rather than as a filesystem access problem. The message wordingwas extensively bikeshedded in hopes of pointing people to theidea that they need to do a software installation before theycan install the extension into the current database.Nathan Bossart, with review/wording suggestions from DanielGustafsson, Chapman Flack, and myselfDiscussion:https://postgr.es/m/3950D56A-4E47-48E7-BF9B-F5F22E268BE7@amazon.com
1 parent98e93a1 commit6f6943f

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

‎src/backend/commands/extension.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -487,11 +487,22 @@ parse_extension_control_file(ExtensionControlFile *control,
487487

488488
if ((file=AllocateFile(filename,"r"))==NULL)
489489
{
490-
if (version&&errno==ENOENT)
490+
if (errno==ENOENT)
491491
{
492-
/* no auxiliary file for this version */
493-
pfree(filename);
494-
return;
492+
/* no complaint for missing auxiliary file */
493+
if (version)
494+
{
495+
pfree(filename);
496+
return;
497+
}
498+
499+
/* missing control file indicates extension is not installed */
500+
ereport(ERROR,
501+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
502+
errmsg("extension \"%s\" is not available",control->name),
503+
errdetail("Could not open extension control file \"%s\": %m.",
504+
filename),
505+
errhint("The extension must first be installed on the system where PostgreSQL is running.")));
495506
}
496507
ereport(ERROR,
497508
(errcode_for_file_access(),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp