Remove extension records and related data directly from the PostgreSQL database when the administrator API is not available or when you need to clean up specific data. If the extension uses local storage, you must also remove its files from the Open VSX server pod.
At the postgres=# prompt, connect to the database:
\c openvsx
You are now connected to the openvsx database as the postgres user.
Find the publisher ID and extension ID:
Identify the extension publisher. Replace <publisher_name> with the actual publisher name:
SELECT id, name FROM namespace WHERE name = '<publisher_name>';
Identify the extension ID. Replace <publisher_id> and <extension_name> with the values from the previous query:
SELECT id, name, namespace_id FROM extension WHERE namespace_id = <publisher_id> AND name = '<extension_name>';
Note the ID of the extension to use as <extension_id> in the next steps.
Optional: Preview extension versions and file resources:
Preview the versions:
SELECT id, version, pre_release, semver_pre_release, semver_is_pre_release FROM extension_version WHERE extension_id = <extension_id> ORDER BY timestamp DESC;
Preview the file resources:
SELECT id, name, type, storage_type FROM file_resource WHERE extension_id = <extension_id> ORDER BY id;
If the storage_type value is local, you must also remove the extension files from the file system on the Open VSX server pod.
Delete the extension from the database:
Run the following commands in a single transaction. Replace <extension_id> with the extension ID from step 2.
BEGIN;
-- 1. Delete all file resources for the extension
DELETE FROM file_resource WHERE extension_id = <extension_id>;
-- 2. Delete all extension reviews
DELETE FROM extension_review WHERE extension_id = <extension_id>;
-- 3. Delete all versions of the extension
DELETE FROM extension_version WHERE extension_id = <extension_id>;
-- 4. Delete the extension entry itself
DELETE FROM extension WHERE id = <extension_id>;
COMMIT;
Important:
Run these commands in order within one transaction. Do not skip the COMMIT command, or the system does not apply the changes.
If the extension used local storage, remove the extension files from the Open VSX server pod:
Get the Open VSX server pod name:
export OPENVSX_POD_NAME=$(oc get pods -n openvsx -o jsonpath="{.items[*].metadata.name}" | tr ' ' '\n' | grep '^openvsx-server' | head -n 1)