Skip to content

Instantly share code, notes, and snippets.

@madalinignisca
Created March 27, 2024 22:23
Show Gist options
  • Save madalinignisca/3c40c3af7d4cbb486ceeb36db5305a6e to your computer and use it in GitHub Desktop.
Save madalinignisca/3c40c3af7d4cbb486ceeb36db5305a6e to your computer and use it in GitHub Desktop.
Rename schema to public in a postgresql database
BEGIN TRANSACTION;
ALTER SCHEMA public RENAME TO public_original;
ALTER SCHEMA my_db RENAME TO public;
DROP SCHEMA public_original CASCADE;
COMMIT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment