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

Suggest Postgres ENUM type for 'classtype' column for tables with inheritance #95

Open
socketpair opened this issue Oct 30, 2014 · 6 comments

Comments

@socketpair
Copy link

http://www.postgresql.org/docs/9.3/static/datatype-enum.html:

pros:
4-bytes per column

cons:
63-bytes names only

Also (not sure) Pony should add index on classtype columns for queries like InheritedTable.select(...). But this index should be controllable (something like index=False). If you agree, I will create separate issue.

@kozlovsky
Copy link
Member

The suggestion about index on classtype column was already proposed on the mailing list and I answered here: https://mailman-mail5.webfaction.com/pipermail/ponyorm-list/2014-September/000123.html. But I don't mind if you created a new issue for this, because the same issue will probably be proposed again in future by somebody, and it will be nice to refer to already existing issue.

@socketpair
Copy link
Author

#97 created. What about ENUM?

@kozlovsky
Copy link
Member

The suggestion to use enum for discriminator column looks interesting, but i think that we should implement migrations at first, because it will be necessary to change enum when new entities are added/deleted

@socketpair
Copy link
Author

#16 -- just issue reference.

@socketpair
Copy link
Author

Also, Enum support is also may mean Python 3.4 ( https://docs.python.org/3/library/enum.html ) enum support as columnt type. End eventually, may be, enum emulation for older Pythons (which is useful for columns like gender or other discrete values)

@jason-johnson
Copy link

Hi

Has there been any movement on this issue? Python is on version 3.6 now so I assume this can be (or is) supported now?

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

3 participants