Re: [sqlalchemy] Is it possible to set the constraint unique = True except for empty string into SQLAlchemy?

2015-08-24 Thread Jonathan Vanasco
If you're using Postgres, you actually wouldn't even need to use a partial index if you can save NULL values instead of empty strings -- a unique constraint would work as intended because Postgres does not compare NULL values to one another. -- You received this message because you are

Re: [sqlalchemy] Is it possible to set the constraint unique = True except for empty string into SQLAlchemy?

2015-08-23 Thread Mike Bayer
On 8/22/15 5:33 PM, Andriy Andrusyk wrote: I use the following column in my table: |email =Column(String(60),unique=True) | However, I need the possibility to save empty strings in this column. Namely, I need something like this: |email

[sqlalchemy] Is it possible to set the constraint unique = True except for empty string into SQLAlchemy?

2015-08-22 Thread Andriy Andrusyk
http://stackoverflow.com/questions/32160819/is-it-possible-to-set-the-constraint-unique-true-except-for-empty-string-into# I use the following column in my table: email = Column(String(60), unique=True) However, I need the possibility to save empty strings in this column. Namely, I need