-
Notifications
You must be signed in to change notification settings - Fork 67
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
Casts depending on extensions are not excluded #209
Comments
I think maybe the way to fix this is in |
I think the treatment of the objects inside extensions, and the relative dependencies, can use some love. Pretty much all the queries to read types from the system tables have grown some clause such as
to avoid dealing with objects belonging to an extension. This results in the dependencies to these objects to be missed, and as a consequence missing the fact the object depend on the extension. We get by probably by creating the extension before pretty much everything else, but that doesn't feel correct. Probably we should do something like:
Now, I don't know exactly the problem behind this wrong drop order, but I feel like that the missing information of the dependency from the cast to the function is a cause. That dependency should be returned by |
I knew I could depend (pun intended) on you for a thoughtful response. Yes, unfortunately, Pyrseas suffers from some premature optimizations (after all, it was going to only deal with simple stuff like schemas/tables/columns and maybe functions and not all the rest of the PG objects). Loading all objects would also be applicable for #185. Alas, I haven't been using it much lately, so aside from thanking you Daniele, I don't what else to say. |
Casts depending on extensions are not excluded. So sql generated for a database that should drop an extension like hstore looks like
BEGIN;
DROP EXTENSION hstore;
DROP CAST (public.hstore AS jsonb);
DROP CAST (public.hstore AS json);
DROP CAST (text[] AS public.hstore);
COMMIT;
Then once the extension is dropped, the next drop cast statement fails
This could be resolved, I think, either by updating the statement in Cast.query, or by emitting DROP CAST IF EXISTS statements.
The text was updated successfully, but these errors were encountered: