On Wednesday, November 1, 2017 at 9:19:17 PM UTC+1, Rodrigo Rosenfeld Rosas 
wrote:
>
> Hi Jeremy. Today I moved our PG production database from 9.6.5 to 10. 
> Using pglogical allowed me to upgrade it with minimal downtime.
>
> However, I also had to restart the application itself because of changes 
> to the OID of pg extensions such as JSON, array and row_type. Without 
> restarting the application it would read JSON columns as text, for example.
>
> We serve PG with Docker and stopping the 9.6 container and restarting the 
> PG 10 container so that it listen in the production port is so fast that PG 
> would be unreachable for just a second or so. However, restarting the 
> applications as well will add another few seconds to the upgrade process, 
> which I'd prefer to avoid if possible.
>
> So, I'm trying to understand whether it would be possible for Sequel to 
> detect that the OIDs have changed and re-register those extensions. I don't 
> actually understand how this part works in client-side tools such as 
> Sequel's PG support, so I currently have no suggestions on actual 
> improvements to the code base or API.
>
> Do you think it would be feasible to detect such changes and allow us to 
> register some proc that would run in such scenario, such as re-registering 
> those extensions and models?
>

No, I don't think it is feasible.  Certainly I don't think Sequel would be 
able to detect OID changes automatically in any efficient manner.  You 
should restart your application when moving to a new database if the OIDs 
have changed.  If you really want to handle this without restarting, you 
would have to tell Sequel when the OIDs changed, and reregister all related 
conversion procs.  That is possible at runtime, but only if you haven't 
frozen the Database object. It is recommended that the Database object be 
frozen in production and when testing.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to