Reputation: 1610
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 = Column(String(60), unique=True, blank=True)
but it doesn't work. Is it possible to implement this within SQLAlchemy? What is correspondent SQL (Postgresql dialect)?
Upvotes: 2
Views: 1463
Reputation: 28106
You have to try to set not an empty string, but a NULL istead. As it's said in PostgreSql documentation NULL-values are not equals.
Upvotes: 1