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

bc2pg postgres table creation - add precision to numeric types #178

Open
smnorris opened this issue May 1, 2024 · 1 comment
Open

bc2pg postgres table creation - add precision to numeric types #178

smnorris opened this issue May 1, 2024 · 1 comment

Comments

@smnorris
Copy link
Owner

smnorris commented May 1, 2024

Data types for numbers in Oracle are generally described by the catalogue api in format 'data_type': 'NUMBER', 'data_precision': '4'.

The precision is not currently used when creating output table in postgres, bc2pg writes all NUMBER columns to a generic NUMERIC type as defined by sqlalchemy, with no precision (despite what comment says, perhaps this is something that was removed)
https://github.com/smnorris/bcdata/blob/main/bcdata/database.py#L156

This is not an issue when working with the data in postgres, but on dumping to other formats the type guessing can be problematic - it would probably be better if the postgres type is better defined.

@smnorris
Copy link
Owner Author

smnorris commented May 1, 2024

Yes, this was tweaked with #117
67bde22

A better NUMBER -> NUMERIC lookup is needed.
https://aws.amazon.com/blogs/database/convert-the-number-data-type-from-oracle-to-postgresql-part-1/

@smnorris smnorris modified the milestone: 0.11.0 Jun 28, 2024
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

No branches or pull requests

1 participant