-
Notifications
You must be signed in to change notification settings - Fork 104
Add PostgresSchema
to manage Postgres schemas with
#206
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
Conversation
9d95720
to
b757d69
Compare
7fe9065
to
4d727a0
Compare
Verify that the table and schema still exists after Postgres refused to drop them.
It's too tricky to get this right. It'll lead to surprises because: 1. It breaks with transaction pooling. 2. Interaction with `SET LOCAL` is strange. A `SET` command after a `SET LOCAL` overrides it. I already shot myself in the foot twice since implementing this.
4d727a0
to
cd67898
Compare
aa99a20
to
f77fd29
Compare
psqlextra/schema.py
Outdated
max_prefix_length = cls.NAME_MAX_LENGTH - len(suffix) | ||
|
||
if len(prefix) > max_prefix_length: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assumptions:
- Prefix len 50
- Suffix len 13
max_prefix_length
would be63 - 13
=50
len(prefix)
=50
is not> max_prefix_length
50
.
The calling function does{prefix}_{suffix}
which results in 50 + 1 + 13 = 64 chars.
Either remove the seperator from the creation functions or consider it here while calculating.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, forgot about the separator. Taken into account now.
No description provided.