Re: [GENERAL] Unique constraint on field inside composite type.

2016-08-22 Thread Adrian Klaver
On 08/22/2016 06:23 PM, Tom Lane wrote: Adrian Klaver writes: On 08/17/2016 11:02 PM, Silk Parrot wrote: CREATE TABLE user ( uuid UUID PRIMARY KEY DEFAULT public.uuid_generate_v4(), google_user system.google_user, facebook_user system.facebook_user, UNIQUE (google_user.email) ); ERROR: syntax

Re: [GENERAL] Unique constraint on field inside composite type.

2016-08-22 Thread Tom Lane
Adrian Klaver writes: > On 08/17/2016 11:02 PM, Silk Parrot wrote: >> CREATE TABLE user ( >> uuid UUID PRIMARY KEY DEFAULT public.uuid_generate_v4(), >> google_user system.google_user, >> facebook_user system.facebook_user, >> UNIQUE (google_user.email) >> ); >> ERROR: syntax error at or near "."

Re: [GENERAL] Unique constraint on field inside composite type.

2016-08-22 Thread Adrian Klaver
On 08/17/2016 11:02 PM, Silk Parrot wrote: Hi, I am trying to model a social login application. The application can support multiple login providers. I am thinking of creating a custom type for each provider. e.g. CREATE TYPE system.google_user AS ( email TEXT ); CREATE TYPE system.face

Re: [GENERAL] Unique constraint on field inside composite type.

2016-08-22 Thread Bruno Wolff III
On Wed, Aug 17, 2016 at 23:02:53 -0700, Silk Parrot wrote: Hi,     I am trying to model a social login application. The application can support multiple login providers. I am thinking of creating a custom type for each provider. e.g. CREATE TABLE user (     uuid UUID PRIMARY KEY DEFAULT pub

Re: [GENERAL] Unique constraint on field inside composite type.

2016-08-22 Thread David G. Johnston
On Thu, Aug 18, 2016 at 2:02 AM, Silk Parrot wrote: > > However, the above create table query reports syntax error: > > ERROR: syntax error at or near "." > LINE 10: UNIQUE (google_user.email) > > Is there a way to create unique constraint on a field inside composite > type? > ​Not tested h

[GENERAL] Unique constraint on field inside composite type.

2016-08-22 Thread Silk Parrot
Hi,     I am trying to model a social login application. The application can support multiple login providers. I am thinking of creating a custom type for each provider. e.g. CREATE TYPE system.google_user AS (    email TEXT ); CREATE TYPE system.facebook_user AS (    id TEXT );    And having

Re: [GENERAL] unique constraint with several null values

2016-07-22 Thread Jim Nasby
On 7/20/16 1:14 PM, Mark Lybarger wrote: This leads me to think I need to create 2^5 or 32 unique constraints to handle the various combinations of data that I can store. Another option would be to create a unique index of a bit varying field that set a bit to true for each field that was NULL

Re: [GENERAL] unique constraint with several null values

2016-07-20 Thread Chris Travers
On Wed, Jul 20, 2016 at 8:14 PM, Mark Lybarger wrote: > I have a relation such as > create table order_item ( id uuid not null primary key, order_id number > not null, item_code text, make text, model text, reason text, size text, > expiration_date timestamp ); > > where the combination of the co

Re: [GENERAL] unique constraint with several null values

2016-07-20 Thread Jerry Sievers
Mark Lybarger writes: > I have a relation such as > create table order_item ( id uuid not null primary key, order_id number not > null, item_code text, make text, model text, reason text, size text, > expiration_date > timestamp ); > > where the combination of the columns order_id, item_code, m

Re: [GENERAL] unique constraint with several null values

2016-07-20 Thread Kevin Grittner
On Wed, Jul 20, 2016 at 1:48 PM, David G. Johnston wrote: > On Wed, Jul 20, 2016 at 2:14 PM, Mark Lybarger wrote: >> Another solution I can think of is to just use a trigger to >> prevent the duplicate rows. If you go that route you will need to use serializable transactions, explicit locking,

Re: [GENERAL] unique constraint with several null values

2016-07-20 Thread David G. Johnston
On Wed, Jul 20, 2016 at 2:14 PM, Mark Lybarger wrote: > I have a relation such as > create table order_item ( id uuid not null primary key, order_id number > not null, item_code text, make text, model text, reason text, size text, > expiration_date timestamp ); > > where the combination of the co

[GENERAL] unique constraint with several null values

2016-07-20 Thread Mark Lybarger
I have a relation such as create table order_item ( id uuid not null primary key, order_id number not null, item_code text, make text, model text, reason text, size text, expiration_date timestamp ); where the combination of the columns order_id, item_code, make, model, reason, size must be unique

Re: [GENERAL] Unique constraint and unique index

2013-08-22 Thread Michael Paquier
On Thu, Aug 22, 2013 at 2:46 AM, Ivan Radovanovic wrote: > Just to verify: > - when unique index is created row is added only to pg_index table but not > to pg_constraint table (although in fact that index is behaving like > constraint on table) Yep. postgres=# create table foo (a int); CREATE TAB

[GENERAL] Unique constraint and unique index

2013-08-21 Thread Ivan Radovanovic
Just to verify: - when unique constraint is created using appropriate syntax rows are added to tables pg_constraint and pg_index (pg_constraint with type 'u' and referring to index with indisunique set to true) - when unique index is created row is added only to pg_index table but not to pg_con

Re: [GENERAL] unique constraint violations

2013-06-26 Thread pg noob
Thank you for the suggestion Steven. Originally I did implement a solution using savepoints and that worked as a way to keep all the work done on the transaction leading up to the constraint violation, but errors would still show up in the Postgres log. With this new function approach there are no

Re: [GENERAL] unique constraint violations

2013-06-26 Thread Steven Schlansker
On Jun 26, 2013, at 11:04 AM, pg noob wrote: > > Hi all, > > There are some places in our application where unique constraint violations > are difficult to avoid due to multithreading. > What we've done in most places to handle this is to retry in a loop. > > Generally it starts by checking

[GENERAL] unique constraint violations

2013-06-26 Thread pg noob
Hi all, There are some places in our application where unique constraint violations are difficult to avoid due to multithreading. What we've done in most places to handle this is to retry in a loop. Generally it starts by checking if a value already exists, if not - try to insert it, which may ca

Re: [GENERAL] unique constraint with significant nulls?

2012-09-26 Thread Mike Blackwell
Ah. A pair of constraints. I see. Thanks! __ *Mike Blackwell | Technical Analyst, Distribution Services/Rollout Management | RR Donnelley* 1750 Wallace Ave | St Charles, IL 60174-3401 Office: 630.313.7818 mike.black

Re: [GENERAL] unique constraint with significant nulls?

2012-09-25 Thread Andreas Joseph Krogh
On 09/25/2012 05:05 PM, Mike Blackwell wrote: How would one go about building a multi-column unique constraint where null is a significant value, eg. (1, NULL) <> (2, NULL)? I see a number of references to not being able to use an index for this, but no mention of an alternative. Any pointers

Re: [GENERAL] unique constraint with significant nulls?

2012-09-25 Thread hubert depesz lubaczewski
On Tue, Sep 25, 2012 at 11:34:36AM -0500, Mike Blackwell wrote: > Interesting, but that assumes there's a value to use in the coalesce that > isn't a valid data value. no, it doesn't. Best regards, depesz -- The best thing about modern society is how easy it is to avoid contact with it.

Re: [GENERAL] unique constraint with significant nulls?

2012-09-25 Thread Mike Blackwell
Interesting, but that assumes there's a value to use in the coalesce that isn't a valid data value. __ *Mike Blackwell | Technical Analyst, Distribution Services/Rollout Management | RR Donnelley* 1750 Wallace Ave | St

Re: [GENERAL] unique constraint with significant nulls?

2012-09-25 Thread hubert depesz lubaczewski
On Tue, Sep 25, 2012 at 10:05:15AM -0500, Mike Blackwell wrote: > How would one go about building a multi-column unique constraint where null > is a significant value, eg. (1, NULL) <> (2, NULL)? > > I see a number of references to not being able to use an index for this, > but no mention of an al

[GENERAL] unique constraint with significant nulls?

2012-09-25 Thread Mike Blackwell
How would one go about building a multi-column unique constraint where null is a significant value, eg. (1, NULL) <> (2, NULL)? I see a number of references to not being able to use an index for this, but no mention of an alternative. Any pointers would be appreciated ___

Re: [GENERAL] UNIQUE constraint on KEY VALUE PAIRS

2011-05-14 Thread InterRob
I am afraid I over-simplyfied my use-case. Sorry. In fact, I am not using a character sequence, but a custom COMPOSITE TYPE; part of which is a hstore: CREATE TYPE SSTORE AS (scope TEXT, kvp hstore); I created some functions and operators around it -- sort-of costly operations for comparing SSTOR

Re: [GENERAL] UNIQUE constraint on character sequences

2011-05-14 Thread David Johnston
Could you index the reverse of the string so the unique part appears first? On May 14, 2011, at 11:20, InterRob wrote: > Dear list, > > I would be pleased if you could share some thoughts with me on the following: > say I wish to maintain a table with all distinct character sequences > (varia

[GENERAL] UNIQUE constraint on character sequences

2011-05-14 Thread InterRob
Dear list, I would be pleased if you could share some thoughts with me on the following: say I wish to maintain a table with all distinct character sequences (variable length) showing series with strong similarities. Example: "abbbabacccdef" "abbbabaccdcdf" "abbbabaccdcgf" ... "qwtrhdffdd" ... "qw

Re: [GENERAL] unique constraint

2010-10-20 Thread Jeff Davis
On Wed, 2010-10-20 at 16:10 -0400, Michael Glaesemann wrote: > Upgrade if you can. Otherwise you can do two updates when rearranging > paragraphs. The first updates them to an "invalid" range which isn't used in > "correct" data and so won't conflict with other values, and the second moves > the

Re: [GENERAL] unique constraint

2010-10-20 Thread Michael Glaesemann
On Oct 20, 2010, at 15:58 , Jamie Kahgee wrote: > I have a table of paragraphs for pages that are in a specific order (1st, > 2nd, 3rd, etc...). > I tried using a unique constraint on the page/pos columns, but was running > into constraint errors when I did an update to move positions - in a >

[GENERAL] unique constraint

2010-10-20 Thread Jamie Kahgee
I have a table of paragraphs for pages that are in a specific order (1st, 2nd, 3rd, etc...). demo=# \d paragraphs Table "toolbox.paragraphs" Column| Type |Modifiers -+-+---

Re: [GENERAL] unique constraint

2008-01-24 Thread Erik Jones
On Jan 24, 2008, at 12:36 PM, Dominique Bessette - Halsema wrote: I'm getting the following error, and I think it's because when i insert into postgres from geoserver's WFS, i first delete then insert the track, and geoserver does this in succession but very fast. If I personally test ins

[GENERAL] unique constraint

2008-01-24 Thread Dominique Bessette - Halsema
I'm getting the following error, and I think it's because when i insert into postgres from geoserver's WFS, i first delete then insert the track, and geoserver does this in succession but very fast. If I personally test inserting two tracks with the same guid in a row, then it works, but because g

Re: [GENERAL] unique constraint on 2 columns

2007-04-26 Thread Scott Marlowe
On Fri, 2007-04-20 at 15:52, Jonathan Vanasco wrote: > I need a certain unique constraint in pg that i can't figure out. > > Given: > > create table test_a ( > id serial , > name_1 varchar(32) , > name_2 varchar(32) > ); > > I need name_1 and

Re: [GENERAL] unique constraint on 2 columns

2007-04-20 Thread Jeff Davis
On Fri, 2007-04-20 at 18:32 -0400, Jonathan Vanasco wrote: > On Apr 20, 2007, at 6:13 PM, Jeff Davis wrote: > > > This is more correct structure, and yes, it would involve a join. > > I know thats the 'more correct' way -- but I can't do the join , > which is why I posted about a 2 column uniqu

Re: [GENERAL] unique constraint on 2 columns

2007-04-20 Thread Jonathan Vanasco
On Apr 20, 2007, at 6:13 PM, Jeff Davis wrote: This is more correct structure, and yes, it would involve a join. I know thats the 'more correct' way -- but I can't do the join , which is why I posted about a 2 column unique index. I tested with a join before posting - i have an already larg

Re: [GENERAL] unique constraint on 2 columns

2007-04-20 Thread Jeff Davis
On Fri, 2007-04-20 at 17:56 -0400, Jonathan Vanasco wrote: > On Apr 20, 2007, at 5:43 PM, Vladimir Zelinski wrote: > > > This looks like more table design problem than > > database limitation. > > The one column should accommodate values from both > > columns with unique index built on this column

Re: [GENERAL] unique constraint on 2 columns

2007-04-20 Thread Tom Lane
Jonathan Vanasco <[EMAIL PROTECTED]> writes: > Given: > create table test_a ( > id serial , > name_1 varchar(32) , > name_2 varchar(32) > ); > I need name_1 and name_2 to both be unique so that: > name_1 never appears in name_1 or name_2

Re: [GENERAL] unique constraint on 2 columns

2007-04-20 Thread Jonathan Vanasco
On Apr 20, 2007, at 5:43 PM, Vladimir Zelinski wrote: This looks like more table design problem than database limitation. The one column should accommodate values from both columns with unique index built on this column. Your requirements tell me that these values are the same nature and should

Re: [GENERAL] unique constraint on 2 columns

2007-04-20 Thread Vladimir Zelinski
This looks like more table design problem than database limitation. The one column should accommodate values from both columns with unique index built on this column. Your requirements tell me that these values are the same nature and should be placed in the same column. To distinguish between them

Re: [GENERAL] unique constraint on 2 columns

2007-04-20 Thread Jorge Godoy
Jonathan Vanasco <[EMAIL PROTECTED]> writes: > I need a certain unique constraint in pg that i can't figure out. > > Given: > > create table test_a ( > id serial , > name_1 varchar(32) , > name_2 varchar(32) > ); > > I need name_1 and name_2 to

[GENERAL] unique constraint on 2 columns

2007-04-20 Thread Jonathan Vanasco
I need a certain unique constraint in pg that i can't figure out. Given: create table test_a ( id serial , name_1 varchar(32) , name_2 varchar(32) ); I need name_1 and name_2 to both be unique so that: name_1 never appear

Re: [GENERAL] unique constraint on more than one tables

2006-12-28 Thread George Pavlov
nodupes before insert on bla_b for each row execute procedure tf_nodupes(); > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Akbar > Sent: Thursday, December 28, 2006 4:01 AM > To: pgsql-general@postgresql.org > Subje

[GENERAL] unique constraint on more than one tables

2006-12-28 Thread Akbar
Hi, Imagine I have two tables, like this: create table bla_a ( id serial primary key, name varchar(31) not null, comment varchar(31) ); create table bla_b ( id serial primary key, name varchar(31) not null, blabla int ); I want to make sure that both tables could not have the same value

Re: [GENERAL] unique constraint when updating tables

2006-08-22 Thread Martijn van Oosterhout
On Tue, Aug 22, 2006 at 08:39:00AM +0800, gao iqiang wrote: > Hello, >I met the following problem when i am using PostgreSQL as a backend > database: >I have a table "tabrel(a int primary key, b int)", and now there are for > example 100 records with column 'a' be from 1 to 100. When i'm go

Re: [GENERAL] unique constraint when updating tables

2006-08-22 Thread A. Kretschmer
am Tue, dem 22.08.2006, um 8:39:00 +0800 mailte gao iqiang folgendes: > Hello, > I met the following problem when i am using PostgreSQL as a backend > database: > I have a table "tabrel(a int primary key, b int)", and now there are for > example 100 records with column 'a' be from 1 to 10

[GENERAL] unique constraint when updating tables

2006-08-22 Thread gao iqiang
Hello,    I met the following problem when i am using PostgreSQL as a backend database:    I have a table "tabrel(a int primary key, b int)", and now there are for example 100 records with column 'a' be from 1 to 100. When i'm going to add one to each 'a' and intended to get 'a' varing from 2 to 10

Re: [GENERAL] Unique constraint or index, case insensitive, on multiple

2006-04-06 Thread MargaretGillon
>Tom Lane <[EMAIL PROTECTED]> wrote on 04/06/2006 11:33:57 AM: > [EMAIL PROTECTED] writes: > > CREATE UNIQUE INDEX resource_refullname > >  ON resource  USING btree  (redtid, (upper(refullname) text_ops)); > > You need something newer than PG 7.3 to do that.  7.3 can't handle > functional indexe

Re: [GENERAL] Unique constraint or index, case insensitive, on multiple fields

2006-04-06 Thread Tom Lane
[EMAIL PROTECTED] writes: > CREATE UNIQUE INDEX resource_refullname > ON resource USING btree (redtid, (upper(refullname) text_ops)); You need something newer than PG 7.3 to do that. 7.3 can't handle functional indexes with more than one column. There are many other good reasons to upgrade a

[GENERAL] Unique constraint or index, case insensitive, on multiple fields

2006-04-06 Thread MargaretGillon
I am on version 7.3. I have been able to build a case insensitive index to keep the refullname column unique with the following: CREATE UNIQUE INDEX  resource_refullname  ON resource  USING btree   (upper(refullname) text_ops); However I have a table where I want to allow  a duplicate refullname

Re: [GENERAL] unique constraint with a null column?

2005-12-30 Thread Tom Lane
CSN <[EMAIL PROTECTED]> writes: > I have three columns, and one of them can be null. I'd > like to create a unique constraint across all three > columns and allow only one null value. e.g. UNIQUE won't do that for you, but you could brute force it with a unique constraint plus a check constraint a

Re: [GENERAL] unique constraint with a null column?

2005-12-30 Thread Jim Buttafuoco
rg" Sent: Fri, 30 Dec 2005 17:02:48 -0500 Subject: Re: [GENERAL] unique constraint with a null column? > try something like this > > jim=# create table a (a text,b text, c text); > CREATE TABLE > jim=# create unique index a_idx on a(a,b,(coalesce(c,'*** NULL IS HERE >

Re: [GENERAL] unique constraint with a null column?

2005-12-30 Thread Jim Buttafuoco
| text | b | text | c | text | Indexes: "a_idx" unique, btree (a, b, (COALESCE(c, '*** NULL IS HERE ***'::text))) -- Original Message --- From: Bruno Wolff III <[EMAIL PROTECTED]> To: CSN <[EMAIL PROTECTED]> Cc: "pgsql-gene

Re: [GENERAL] unique constraint with a null column?

2005-12-30 Thread CSN
--- Bruno Wolff III <[EMAIL PROTECTED]> wrote: > On Fri, Dec 30, 2005 at 13:30:40 -0800, > CSN <[EMAIL PROTECTED]> wrote: > > I have three columns, and one of them can be null. > I'd > > like to create a unique constraint across all > three > > columns and allow only one null value. e.g. > > >

Re: [GENERAL] unique constraint with a null column?

2005-12-30 Thread Bruno Wolff III
On Fri, Dec 30, 2005 at 13:30:40 -0800, CSN <[EMAIL PROTECTED]> wrote: > I have three columns, and one of them can be null. I'd > like to create a unique constraint across all three > columns and allow only one null value. e.g. > > a|b|c > abc|123|null > abc|123|null # not allowed > abc|456|null

[GENERAL] unique constraint with a null column?

2005-12-30 Thread CSN
I have three columns, and one of them can be null. I'd like to create a unique constraint across all three columns and allow only one null value. e.g. a|b|c abc|123|null abc|123|null # not allowed abc|456|null abc|456|987 abc|456|876 def|456|null def|456|null # not allowed Currently, the 'not all

Re: [GENERAL] Unique constraint violation on serial column

2005-04-12 Thread Bill Chandler
All, In the pg_dump output is the command: COPY event_tbl (d1, ..., evt_id) FROM stdin; followed by all the data for the table. There are 23040 rows. The last value for evt_id is 23040. So far so good. Then the last statement in the pg_dump output is: SELECT pg_catalog.setval('event_tbl_evt

Re: [GENERAL] Unique constraint violation on serial column

2005-04-12 Thread Alvaro Herrera
On Tue, Apr 12, 2005 at 08:58:41AM -0700, Bill Chandler wrote: > I did not intend to put explicit values in the > 'evt_id' column. I thought the six values in the > insert command correspond to the 1st six columns in > the create table command, namely d1, obj_id, d2, val, > correction and delta an

Re: [GENERAL] Unique constraint violation on serial column

2005-04-12 Thread Bill Chandler
I did not intend to put explicit values in the 'evt_id' column. I thought the six values in the insert command correspond to the 1st six columns in the create table command, namely d1, obj_id, d2, val, correction and delta and 'evt_id' is set to the nextval() automagically. Is that not correct?

Re: [GENERAL] Unique constraint violation on serial column

2005-04-12 Thread Alvaro Herrera
On Tue, Apr 12, 2005 at 08:48:15AM -0700, Bill Chandler wrote: > How does one find out the current sequence value? Is > there a way to change it? Using the function setval() you can change it. SELECT * from sequencename to find out. -- Alvaro Herrera (<[EMAIL PROTECTED]>) "Si quieres ser crea

Re: [GENERAL] Unique constraint violation on serial column

2005-04-12 Thread Bill Chandler
I was able to get a pg_dump of the table in question. It has 23040 rows in it. evt_id column ranges from 1 to 23040. I used the dump to create a new database. All inserts fail with same error (unique constraint violation). However, I am wondering if this is just the result of the fact that

Re: [GENERAL] Unique constraint violation on serial column

2005-04-12 Thread Alvaro Herrera
On Tue, Apr 12, 2005 at 07:59:55AM -0700, Bill Chandler wrote: > I'm sorry, was working on little sleep yesterday. You > are right, the table was created with the columns in > the following order: > > d1, obj_id, d2, val, correction, delta, evt_id > > The insert command looks something like: >

Re: [GENERAL] Unique constraint violation on serial column

2005-04-12 Thread Bill Chandler
I'm sorry, was working on little sleep yesterday. You are right, the table was created with the columns in the following order: d1, obj_id, d2, val, correction, delta, evt_id The insert command looks something like: INSERT INTO EVENT_TBL VALUES(1039850293991, 145, 1039110343000, '10.25', 1, 739

Re: [GENERAL] Unique constraint violation on serial column

2005-04-11 Thread Ragnar Hafstað
On Mon, 2005-04-11 at 11:03 -0700, Bill Chandler wrote: > ERROR: duplicate key violates unique constraint > event_tbl_evt_id_key > EVENT_TBL > evt_id bigserial, unique > d1 numeric(13) > obj_id numeric(6) > d2 numeric(13) > val varchar(22) > correction n

Re: [GENERAL] Unique constraint violation on serial column

2005-04-11 Thread Bill Chandler
Tom, This is not the EXACT command (don't have that since this a client site and they did not have logging turned on) but the insert command would have looked something like: INSERT INTO EVENT_TBL VALUES(1039850293991, 'X.Y.Z', 1039110343000, '10.25', 1, 739950991) For what its worth, the comman

Re: [GENERAL] Unique constraint violation on serial column

2005-04-11 Thread Tom Lane
Bill Chandler <[EMAIL PROTECTED]> writes: > Client is getting the following error when attempting > to do an insert on a table: > ERROR: duplicate key violates unique constraint > event_tbl_evt_id_key What's the exact query (or queries) causing this? Do you have any triggers or rules that might

[GENERAL] Unique constraint violation on serial column

2005-04-11 Thread Bill Chandler
Hello, Client is getting the following error when attempting to do an insert on a table: ERROR: duplicate key violates unique constraint event_tbl_evt_id_key Client is using PostgreSQL 7.4.2 on Sparcv9 running Solaris. We have the following tables: EVENT_TBL evt_id bigserial, unique d1

[GENERAL] UNIQUE constraint violations and transactions

2001-10-26 Thread Eric Ridge
Hi! I've got a UNIQUE constraint on a field, and obviously, when I try to insert a duplicate value, I get a WARNING via psql (and an Exception via the JDBC drivers) saying I tried to violate the constraint. No biggie. This is what I expect. The tricky part comes in when I violate the constraint

Re: [GENERAL] UNIQUE constraint and indexing

2001-09-28 Thread Daniel M . Kurry
On Thu, Sep 27, 2001 at 06:30:50PM -0400, some SMTP stream spewed forth: > Is the index, created implicitely by "UNIQUE" constraint, the same > kind as created explicitely with "CREATE INDEX"? In other words, > is the following piece of SQL redundant? > > create table foo ( >bar serial

[GENERAL] UNIQUE constraint fails

2001-02-23 Thread Louis-David Mitterrand
With 7.1b4: test=# create table auction_type(id serial,login text,birthday timestamp); test=# create table auction(unique(login)) inherits("auction_type"); ERROR: inherited attribute "login" cannot be a PRIMARY KEY because it is not marked NOT NULL But I didn't ask that "login" be a PRIMARY K

Re: [GENERAL] unique constraint - bug?

2000-07-20 Thread Oliver Elphick
Tom Lane wrote: >Merrill Oveson <[EMAIL PROTECTED]> writes: >> It appears as though the null value inserted for column b causes an >> abrogation of the unique constaint. > >Two nulls are never considered equal, therefore the unique constraint >does not trigger. > >This is correct b

Re: [GENERAL] unique constraint - bug?

2000-07-19 Thread Tom Lane
Merrill Oveson <[EMAIL PROTECTED]> writes: > It appears as though the null value inserted for column b causes an > abrogation of the unique constaint. Two nulls are never considered equal, therefore the unique constraint does not trigger. This is correct behavior according to SQL92 4.10.2:

RE: [GENERAL] unique constraint - bug?

2000-07-19 Thread Mikheev, Vadim
> unique (a, b, c) > ); > > insert into letter values('1','2','3'); > insert into letter values('1','2','3'); > > insert into letter (a,c) values ('1','3'); >

[GENERAL] unique constraint - bug?

2000-07-19 Thread Merrill Oveson
All: Run the following script: drop table letter; create table letter ( a char(1), b char(1), c char(1), unique (a, b, c)

[GENERAL] UNIQUE constraint no longer works under 6.5.1

1999-08-13 Thread Mark Dalphin
POSTGRESQL BUG REPORT TEMPLATE Your name : Mark Dalphin Your email address : [EMAIL PRO