New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Postgres "ERROR: must be superuser to create a base type" during clean of DOMAIN #1803
Comments
Workaround: Add the following to beforeClean.sql: DO LANGUAGE plpgsql $$ DECLARE
v_sql TEXT;
BEGIN
FOR v_sql IN (SELECT FORMAT('DROP DOMAIN %I CASCADE', DOMAIN_NAME)
FROM INFORMATION_SCHEMA.DOMAINS
WHERE DOMAIN_SCHEMA = CURRENT_SCHEMA) LOOP
EXECUTE v_sql;
END LOOP;
END;
$$; |
I can't seem to reproduce this. Flyway only recreates base types when cleaning Pseudo-types (category This most likely means you have some other type in your database which Flyway is attempting to clean and fails due to a permission issue. |
I'm hitting this issue in Flyway 5.0.7 and Postgres 9.6. To reproduce, you need a domain whose type comes back as
Flyway, in |
Looking into this a bit more, you can exclude domains from the results of the query where |
@johnwright Thank you very much for the detailed investigation. That was super useful! |
… type during clean of DOMAIN
What version of Flyway are you using?
4.2.0
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin, SBT plugin, ANT tasks)
Reproduced issued with command line.
What database are you using (type & version)?
Postgres 9.6.5
What operating system are you using?
macOS 10.12.6
What did you do?
(Please include the content causing the issue, any relevant configuration settings, and the command you ran)
Run "flyway migrate"
Run "flyway clean"
What did you expect to see?
"flyway clean" successfully deletes the domain "uuid_not_null_dom"
What did you see instead?
The text was updated successfully, but these errors were encountered: