Skip to content

Create db then switch conn, rather than use dblink#587

Closed
ChrisLovering wants to merge 1 commit into
mainfrom
fix-database-switch
Closed

Create db then switch conn, rather than use dblink#587
ChrisLovering wants to merge 1 commit into
mainfrom
fix-database-switch

Conversation

@ChrisLovering
Copy link
Copy Markdown
Member

The previous implementation would succesfully create the metricity db, but the tables and rows would be inserted into pysite.

This is because dblink doesn't switch contexts within the script, as psql doesn't support this.

If we were to stick with 1 sql file, we would need to wrap every single statement into a dblink_exec() call to force psql to exec on the other db.

The previous implementation would succesfully create the metricity db, but the tables and rows would be inserted into pysite.

This is because dblink doesn't switch contexts within the script, as psql doesn't support this.

If we were to stick with 1 sql file, we would need to wrap every single statement into a dblink_exec() call to force psql to exec on the other db.
@coveralls
Copy link
Copy Markdown

coveralls commented Sep 9, 2021

Coverage Status

Coverage remained the same at 100.0% when pulling 84fd74e on fix-database-switch into 50e3f21 on main.

@MarkKoz
Copy link
Copy Markdown
Contributor

MarkKoz commented Sep 9, 2021

So, is this not actually an issue?

@ChrisLovering
Copy link
Copy Markdown
Member Author

ChrisLovering commented Sep 10, 2021

So, is this not actually an issue?

Yea, this is an issue, but has been superseded by #588 since this implementation didn't work for people who also run metricity too (Since it runs it's own migrations and conflicts).

See https://canary.discord.com/channels/267624335836053506/635950537262759947/885573792376709161 for an overview of what our solution is

@ChrisLovering ChrisLovering deleted the fix-database-switch branch September 10, 2021 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants