Re: [GENERAL] EXCLUDE constraint with not equals

2015-03-03 Thread Kai Groner
On Tue, Mar 3, 2015 at 11:15 AM, Kai Groner wrote: > I found it necessary to add the gist_text_ops opclass for the inequality: > > CREATE TABLE person ( > id INTEGER PRIMARY KEY, > "user" TEXT, > email TEXT NOT NULL, > EXCLUDE USING gist (email WI

Re: [GENERAL] EXCLUDE constraint with not equals

2015-03-03 Thread Kai Groner
On Tue, Mar 3, 2015 at 3:27 AM, Emre Hasegeli wrote: > > > Given the following table, I would like to ensure that all the rows for an > > email that have a user defined map to the same user. > > > > CREATE TABLE person ( > > id INTEGER PRIMARY KEY, > > user TEXT, > > email TEXT NOT NULL); >

Re: [GENERAL] EXCLUDE constraint with not equals

2015-02-10 Thread Kai Groner
Hi Thomas, The partial unique index would prevent multiple person records with the same email. I want to allow that as long as they agree on the value of user. Kai On Tue, Feb 10, 2015 at 2:14 AM, Thomas Kellerer wrote: > Kai Groner schrieb am 10.02.2015 um 01:38: > > Given the

[GENERAL] EXCLUDE constraint with not equals

2015-02-09 Thread Kai Groner
Hello, Given the following table, I would like to ensure that all the rows for an email that have a user defined map to the same user. CREATE TABLE person ( id INTEGER PRIMARY KEY, user TEXT, email TEXT NOT NULL); What I think I'm looking for is something like this: CREATE TABLE person (