Re: [SQL] Partitioning by letter question

2010-01-30 Thread John Lister
wrote: Hi, I was wondering if this was possible. I'm trying to partition a table, which is straightforward enough thanks to the great documentation, but i have a question: If I partition using something like a product_id for example and have check constraints such as (id>=1000 and id<2000) t

Re: [SQL] Partitioning by letter question

2010-01-30 Thread Scott Marlowe
On Sat, Jan 30, 2010 at 7:11 AM, John Lister wrote: >> wrote: > > .> Hi, I was wondering if this was possible. I'm trying to partition a > table, > .> which is straightforward enough thanks to the great documentation, but i >>> >>> have a question: >>> >>> If I partition using something like a pr

[SQL] Howto have a unique restraint on UPPER (textfield)

2010-01-30 Thread Andreas
Hi, is there a way to define a unique restraint on UPPER (textfield)? E.g. mytable ( name_id serial PRIMARY KEY, name varchar(255), UNIQUE ( upper (name) ) ) psql throws a syntax error because of the upper() function. I need to prohibit that 2 of strings like cow, Cow, CoW appe

Re: [SQL] Howto have a unique restraint on UPPER (textfield)

2010-01-30 Thread Joshua Tolley
On Sun, Jan 31, 2010 at 03:26:14AM +0100, Andreas wrote: > Hi, > > is there a way to define a unique restraint on UPPER (textfield)? > > E.g. mytable ( >name_id serial PRIMARY KEY, >name varchar(255), >UNIQUE ( upper (name) ) > ) > > psql throws a syntax error because of the upper() fu