Skip to content

Conversation

JelteF
Copy link
Collaborator

@JelteF JelteF commented May 23, 2025

This PR starts auto-installing missing extensions if both of the following are true:

  1. duckdb.autoinstall_known_extensions is set to true
  2. The extension is listed in the duckdb.extensions table.

Fixes #686
Fixes #687

Copy link
Collaborator

@Y-- Y-- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, added minor nits and looks like the test are sad ;-)

SET search_path = pg_catalog, pg_temp
SET duckdb.force_execution = false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume it is the case - but will that be automatically reset after execution of the function?

Comment on lines 731 to 732
-- TODO: Maybe rename/replace "enabled" column of extensions with autoload or
-- something similar.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel we're never gonna see this TODO after 1.0 ships :-) Maybe we should move it to where the column is used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this was more meant as a "review todo". So it served it's purpose by starting this discussion ;) I think autoload makes more sense as a name.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah autoload makes sense indeed.

@@ -119,7 +119,7 @@ char *duckdb_postgres_role = strdup("");

int duckdb_maximum_threads = -1;
char *duckdb_maximum_memory = strdup("4GB");
char *duckdb_disabled_filesystems = strdup("LocalFileSystem");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we want that by default anymore?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this change to a follow up PR

Comment on lines 173 to 174
if (ret != SPI_OK_INSERT)
elog(ERROR, "SPI_exec failed: error code %s", SPI_result_code_string(ret));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (ret != SPI_OK_INSERT)
elog(ERROR, "SPI_exec failed: error code %s", SPI_result_code_string(ret));
if (ret != SPI_OK_INSERT) {
elog(ERROR, "SPI_exec failed: error code %s", SPI_result_code_string(ret));
}

also - shouldn't we uninstall the extension? (to maintain a consistent state?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uninstalling seems unwanted, we don't know if it was already there through other means. Also this is really never supposed to throw an error.

@JelteF JelteF force-pushed the redesign-extension-management branch from f8117ed to dad6e05 Compare May 27, 2025 08:21
@JelteF JelteF force-pushed the redesign-extension-management branch from dad6e05 to 5d86474 Compare May 27, 2025 08:25
@JelteF JelteF marked this pull request as draft May 27, 2025 08:37
@JelteF JelteF force-pushed the redesign-extension-management branch 4 times, most recently from e5a63ae to c6c6a89 Compare May 27, 2025 15:37
@JelteF JelteF force-pushed the redesign-extension-management branch from c6c6a89 to 533f820 Compare May 27, 2025 15:58
@JelteF JelteF requested a review from Y-- May 27, 2025 16:34
@JelteF JelteF marked this pull request as ready for review May 27, 2025 16:34
@JelteF JelteF merged commit aaedec1 into main May 28, 2025
6 checks passed
@JelteF JelteF deleted the redesign-extension-management branch May 28, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically re-install extensions if they are not available Add ability to disallow installing any extensions
2 participants