Skip to content
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

Column creation and copying should use attnum #995

Closed
Tracked by #839
mathemancer opened this issue Jan 20, 2022 · 0 comments · Fixed by #1110
Closed
Tracked by #839

Column creation and copying should use attnum #995

mathemancer opened this issue Jan 20, 2022 · 0 comments · Fixed by #1110
Assignees
Labels
type: enhancement New feature or request work: backend Related to Python, Django, and simple SQL

Comments

@mathemancer
Copy link
Contributor

Problem

Currently, most column creation and copying operations are using name or index to identify columns. This is brittle, and we've decided to change to using the attnum property of columns instead.

Proposed solution

Each function in db/columns/operations/create.py should use attnum instead of column_index, and should properly use the table_oid, attnum pair to identify columns for its logic. Use the function get_column_name_from_attnum function in db.columns.operations.select for this where needed.

Additional context

We'll clearly need to modify any place where the functions in the above file are called as well.

Beware, some internal functions in the copying logic will need to be changed, and some have misleading variable names (e.g., _duplicate_column_data). We may need to connect some pieces with logic to get index from attnum where other code we're not changing is called.

@mathemancer mathemancer added type: enhancement New feature or request good first issue Everything in "Help wanted", PLUS being relatively easy and straightforward to implement. help wanted Community contributors can implement this work: backend Related to Python, Django, and simple SQL work: database ready Ready for implementation labels Jan 20, 2022
@silentninja silentninja added status: started and removed ready Ready for implementation labels Feb 17, 2022
@silentninja silentninja self-assigned this Feb 28, 2022
@kgodey kgodey removed good first issue Everything in "Help wanted", PLUS being relatively easy and straightforward to implement. help wanted Community contributors can implement this labels Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request work: backend Related to Python, Django, and simple SQL
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants