Skip to main content

Command Syntax

UNINSTALL EXTENSION 'extension_name';
You must remove all columns and variables that use types from the extension before uninstalling. The uninstall process will then remove all functions and types provided by the extension.

Prerequisites

  • Administrative access to VillageSQL
  • No tables using custom types from the extension
  • Backup of data if extension stores custom data

Uninstall Steps

1. Check for Dependencies

Find tables using custom types from the extension:
SELECT
    schema_name,
    table_name,
    column_name,
    type_name
FROM villagesql.custom_columns
WHERE extension_name = 'vsql_complex';
If results exist, you must drop or alter those tables first:
-- Option 1: Drop the table
DROP TABLE mydb.mytable;

-- Option 2: Alter to remove custom type column
ALTER TABLE mydb.mytable DROP COLUMN my_complex_column;

2. Uninstall the Extension

UNINSTALL EXTENSION 'vsql_complex';
What this removes:
  • ✅ All UDFs provided by the extension (from mysql.func)
  • ✅ Custom type definitions from villagesql.custom_types
  • ✅ Extension registration from villagesql.extensions
  • ✅ Metadata from villagesql.custom_columns (if no tables use it)
What this does NOT remove:
  • ❌ The .veb file remains in vef_dir
  • ❌ Expanded directories in _expanded/ remain temporarily
  • ❌ Table data (you must drop tables with custom types first)
Expansion directories in _expanded/{extension}/{sha256}/ are cleaned up automatically on server restart.

3. Verify Uninstall

-- Check extension is gone
SELECT * FROM INFORMATION_SCHEMA.EXTENSIONS WHERE EXTENSION_NAME = 'vsql_complex';
-- Should return no rows

-- Verify functions removed
SELECT COMPLEX(1.0, 2.0);
-- Error: FUNCTION COMPLEX does not exist

Common Errors

ErrorCauseSolution
Cannot uninstall extension: types in useTables have columns using custom typesQuery villagesql.custom_columns and drop/alter those tables
Extension not foundExtension not installedVerify with SELECT * FROM INFORMATION_SCHEMA.EXTENSIONS

Optional: Remove .veb File

The .veb file remains after uninstall. To remove completely:
# Find vef_dir
mysql -u root -p -e "SHOW VARIABLES LIKE 'vef_dir';"

# Delete .veb file
sudo rm /path/to/vef_dir/vsql_complex.veb
The .veb file can be kept safely for future reinstallation. Deleting it does not affect server performance.

Reinstalling

To reinstall an extension, use INSTALL EXTENSION again (if .veb file still exists):
INSTALL EXTENSION 'vsql_complex';
See Installing Extensions for details.

Next Steps