On 02/04/10 13:20 +0200, Chenal Bertrand wrote:
> Le 02/04/10 11:10, Cédric Krier a écrit :
> > Hi,
> >
> > I would like to bring some attention on the issue1422[1]. I think we should
> > try to fix this before release 1.6.0.
> > There is a possible solution that will work only for PostgreSQL:
> >
> >      CREATE UNIQUE INDEX "index" ON "table" ("name", COALESCE("parent", 0));
> >
> > Is there anybody who has better solution?
> >
> >
> > [1] http://bugs.tryton.org/roundup/issue1422
> >    
> 
> For me it's a good solution, but what about Mysql ?
> (for Sqlite it's already handled in the python code).

SQLite doesn't work because NULL != NULL (for PostgreSQL, SQLite and MySQL).
So it will not work for SQLite nor MySQL because they don't allow to put
expressions in the definition of an index (only column names).

-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: [email protected]
Website: http://www.b2ck.com/

Attachment: pgpHumbmNHD4Y.pgp
Description: PGP signature

Reply via email to