-
-
Notifications
You must be signed in to change notification settings - Fork 508
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
DataError when underlying type changes #183
Comments
Caching of the attribute is necessary but it's local to the scope you have registered the composite. Avoid using register_composite with global=True: use it on the connection or on the cursor, and dispose the connection or the cursor after the data type is changed. Alternatively just call register_composite again. |
Originally submitted by: Chad Whitacre Thanks @dvarrazzo. Scoping our |
Hello Chad, the use case for such subclass is fairly restricted, and I think it would be more the hassle to document it than its general usefulness, not to mention that people is usually unhappy to get a new feature in rel. 2.5.2. So my suggestion is you make your own subclass of the adapter, which should be something as easy as (untested):
this should do everything you need. |
Originally submitted by: Chad Whitacre Sounds sensible. Thanks Daniele! :-) |
Originally submitted by: Chad Whitacre (whit537)
psycopg2 caches the attributes of composite types, so that when the type is altered in the database, the next attempt to cast that type in psycopg2 results in a DataError. This seems to introduce a race condition between modifying the database and restarting processes accessing the database.
More information:
gratipay/gratipay.com#1583
The text was updated successfully, but these errors were encountered: