Re: [GENERAL] Create unique index or constraint on part of a column

2011-03-07 Thread Jeff Davis
On Mon, 2011-03-07 at 23:30 +, Ruben Blanco wrote: > Hi: > > Is there anyway to create a unique index or constraint on part of a > column? > > Something like this, but something that works ;-) > > ALTER TABLE invoices > ADD CONSTRAINT cons UNIQUE (EXTRACT(YEAR FROM invoice_date), > inn

Re: [GENERAL] Create unique index or constraint on part of a column

2011-03-07 Thread Thomas Kellerer
Ruben Blanco wrote on 08.03.2011 00:30: Hi: Is there anyway to create a unique index or constraint on part of a column? Something like this, but something that works ;-) ALTER TABLE invoices ADD CONSTRAINT cons UNIQUE (EXTRACT(YEAR FROM invoice_date), innvoice_number); Thanks for any h

[GENERAL] Create unique index or constraint on part of a column

2011-03-07 Thread Ruben Blanco
Hi: Is there anyway to create a unique index or constraint on part of a column? Something like this, but something that works ;-) ALTER TABLE invoices ADD CONSTRAINT cons UNIQUE (EXTRACT(YEAR FROM invoice_date), innvoice_number); Thanks for any help. Ruben,